on master help sign in
Only permit exact hotmaps
commitcb2eb0db8f304f5a4dfdbde26b35425b8cb7ece8 authorHuw Campbell <huw.campbell@ambiata.com> dateThu 4 Jan 2018, 15:59 (9 years ago) parent96a4506
2 files changed+1−4
grenade.cabal−3 src/Grenade/Utils/OneHot.hs+1−1
grenade.cabal−3
@@ -42,12 +42,9 @@ library
4242 , containers >= 0.5 && < 0.6
4343 , cereal >= 0.5 && < 0.6
4444 , deepseq >= 1.4 && < 1.5
45− , exceptions == 0.8.*
4645 , hmatrix == 0.18.*
4746 , MonadRandom >= 0.4 && < 0.6
48− , mtl >= 2.2.1 && < 2.3
4947 , primitive >= 0.6 && < 0.7
50− , text == 1.2.*
5148 , singletons >= 2.1 && < 2.4
5249 , vector >= 0.11 && < 0.13
5350
src/Grenade/Utils/OneHot.hs+1−1
@@ -57,7 +57,7 @@ hotMap n as =
5757 let len = fromIntegral $ natVal n
5858 uniq = [ c | (c:_) <- group $ sort as]
5959 hotl = length uniq
60− in if hotl <= len
60+ in if hotl == len
6161 then
6262 Just (M.fromList $ zip uniq [0..], V.fromList uniq)
6363 else Nothing