on master help sign in
Only permit exact hotmaps
cb2eb0dHuw Campbell
grenade.cabal−3
@@ -42,12 +42,9 @@ library
42 , containers >= 0.5 && < 0.6
42 , containers >= 0.5 && < 0.6
43 , cereal >= 0.5 && < 0.6
43 , cereal >= 0.5 && < 0.6
44 , deepseq >= 1.4 && < 1.5
44 , deepseq >= 1.4 && < 1.5
45− , exceptions == 0.8.*
46 , hmatrix == 0.18.*
45 , hmatrix == 0.18.*
47 , MonadRandom >= 0.4 && < 0.6
46 , MonadRandom >= 0.4 && < 0.6
48− , mtl >= 2.2.1 && < 2.3
49 , primitive >= 0.6 && < 0.7
47 , primitive >= 0.6 && < 0.7
50− , text == 1.2.*
51 , singletons >= 2.1 && < 2.4
48 , singletons >= 2.1 && < 2.4
52 , vector >= 0.11 && < 0.13
49 , vector >= 0.11 && < 0.13
53
50
src/Grenade/Utils/OneHot.hs+1−1
@@ -57,7 +57,7 @@ hotMap n as =
57 let len = fromIntegral $ natVal n
57 let len = fromIntegral $ natVal n
58 uniq = [ c | (c:_) <- group $ sort as]
58 uniq = [ c | (c:_) <- group $ sort as]
59 hotl = length uniq
59 hotl = length uniq
60− in if hotl <= len
60+ in if hotl == len
61 then
61 then
62 Just (M.fromList $ zip uniq [0..], V.fromList uniq)
62 Just (M.fromList $ zip uniq [0..], V.fromList uniq)
63 else Nothing
63 else Nothing