cossio / RestrictedBoltzmannMachines.jl

Train and sample Restricted Boltzmann machines in Julia
MIT License
15 stars 3 forks source link

Zero hidden units #11

Closed cossio closed 2 years ago

cossio commented 2 years ago

Many ops fail with zero hidden units, even though they are well-defined mathematically.

julia> reshape(randn(0,4),0,:)
ERROR: DivideError: integer division error
Stacktrace:
 [1] div
   @ ./int.jl:284 [inlined]
 [2] divrem
   @ ./div.jl:162 [inlined]
 [3] divrem
   @ ./div.jl:158 [inlined]
 [4] _reshape_uncolon
   @ ./reshapedarray.jl:127 [inlined]
 [5] reshape(parent::Matrix{Float64}, dims::Tuple{Int64, Colon})
   @ Base ./reshapedarray.jl:118
 [6] reshape(::Matrix{Float64}, ::Int64, ::Colon)
   @ Base ./reshapedarray.jl:117
 [7] top-level scope
   @ REPL[1]:1
cossio commented 2 years ago

Closed by https://github.com/cossio/RestrictedBoltzmannMachines.jl/commit/65cc5622b7231df720462272baf2408111420e78