cossio / RestrictedBoltzmannMachines.jl

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

activations conversions #10

Closed cossio closed 1 year ago

cossio commented 2 years ago

https://github.com/cossio/RestrictedBoltzmannMachines.jl/blob/f71a30cc6e7cadeb5897fe10e089ef2a22c88736/src/rbm.jl#L310-L311

For binary units, that converts to bool/Int and will not hit blas in the product vflat * hflat'. This is not good because that product reduces over batches and should be faster with BLAS.

In general, activations_convert should probably convert to the weight eltype always. ... and to support CUDA perhaps use the array type of the weigths.