Git Product home page Git Product logo

Comments (5)

liulhdarks avatar liulhdarks commented on July 3, 2024

@Darwin2011 I think (ph_mean[i] * input[j] - nh_means[i] * nv_samples[j]) is right. The weights gradient should be data-model。

from deeplearning.

Darwin2011 avatar Darwin2011 commented on July 3, 2024

@liulhdarks ,thanks
The following code shows that the different weight update method. Could you check the following link?
https://github.com/echen/restricted-boltzmann-machines/blob/master/rbm.py

from deeplearning.

liulhdarks avatar liulhdarks commented on July 3, 2024

@Darwin2011 https://github.com/echen/restricted-boltzmann-machines/blob/master/rbm.py doesn't use the visible layer after sampling when updating weights. You can refer to the follow ML frameworks.

INDArray wGradient = input.transpose().mmul(probHidden.getSecond()).sub(
nvSamples.transpose().mmul(nhMeans));

DoubleMatrix wGradient = input.transpose().mmul(hProp1.prob)
.sub(vPropn.sample.transpose().mmul(hPropn.prob));

Hope to help you!

from deeplearning.

Darwin2011 avatar Darwin2011 commented on July 3, 2024

@liulhdarks thanks for your kind help. I will follow your guide.

Best Regards

from deeplearning.

luochao436 avatar luochao436 commented on July 3, 2024

@liulhdarks @yusugomori
I think the update for W , a , b should as follows:
self.W += lr * (numpy.dot(self.input.T, ph_mean - numpy.dot(nv_samples.T, nh_means))
self.vbias += lr * numpy.mean(self.input - nv_samples, axis=0)
self.hbias += lr * numpy.mean(ph_mean - nh_means, axis=0)

In origin python RBM.py. , self.W and self.hbias is not correct. This problem is also in C/C++ files, but the W has been fixed.
If I am not right, please inform me.
Thanks.

from deeplearning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.