Coder Social home page Coder Social logo

yell / boltzmann-machines Goto Github PK

View Code? Open in Web Editor NEW
841.0 35.0 133.0 362.86 MB

Boltzmann Machines in TensorFlow with examples

License: MIT License

Shell 0.01% Python 0.14% Makefile 0.01% Jupyter Notebook 99.73% TeX 0.13% Dockerfile 0.01%
ais annealed-importance-sampling boltzmann-machines contrastive-divergence-algorithm dbm deep-learning energy-based-model gibbs-sampling keras machine-learning

boltzmann-machines's People

Contributors

hannesdm avatar jordanbcs avatar srmourasilva avatar yell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boltzmann-machines's Issues

Run with Docker on Windows 10

As far as I can tell from the instructions, this requires nvidia-docker to run with docker, and nvidia-docker does not run on Windows 10 due to lack of GPU passthrough in that OS (seems like it might work on Windows 2016 Server though). But there is no mention of this anywhere. It seems it should work in a non-GPU configuration, which would suffice for learning purposes.

So is nvidia-docker a requirement, or is there some undocumented way to get this to work with docker on Windows 10? Without GPU support?

Custom metrics

Continue discussion #7 (comment)

The current lib has a lot of metrics, but in the research is expected try other metrics.

Example:

def my_custom_evaluate_function(metric_name, model, minibatch):
    """Mean of activated units after reconstruction"""
    h_means = model._means_h_given_v(minibatch)
    h0 = self._sample_h_given_v(h_means)
    v_means = model._means_v_given_h(gh)
    v1 = self._sample_v_given_h(v_means)

    with tf.name_scope(metric_name):
        tf.summary.scalar(metric_name, tf.mean(v1, axis=1))  # Maybe axis=1


rbm = BernoulliRBM(n_visible=784, n_hidden=args.n_hidden,
    metrics_config=dict(
        # The default metrics
        msre=True,
        pll=True,
        feg=True,
        train_metrics_every_iter=1000,
        val_metrics_every_epoch=2,
        feg_every_epoch=4,
        n_batches_for_feg=50,
        # New metrics
        my_custom_evaluate=my_custom_evaluate_function
    ),
    verbose=True,
)

Add build

The code has unit tests, but the lack of a continuous deploy caused the new version to break in python3

  • Travis build
  • Coverage
  • Readme update

Using RBM to train a new and different dimension data set

Dear, I want to use your RBM to train for my 3D dataset, I have processed data already and just need some setting so can you guide me a bit to use it and get all the figures and plots,
Am very new to this area therefore need a little guidance to start.

Biases?

Are the biases for the models stored somehwere?

Right now they cannot be loaded fully from the files.

reconstruct

I am looking for something equivalent to model.predict(X_test) in keras.

res = dbm.reconstruct(X_test)

Traceback (most recent call last):
File "/home/yunus/PycharmProjects/boltz_/boltzmann-machines-clone/examples/dbm_mnist.py", line 402, in
main()
File "/home/yunus/PycharmProjects/boltz_/boltzmann-machines-clone/examples/dbm_mnist.py", line 377, in main
res = dbm.reconstruct(X_test)
File "/home/yunus/PycharmProjects/boltz_/boltzmann-machines-clone/boltzmann_machines/base/tf_model.py", line 28, in wrapped_f
res = f(model, *args, **kwargs)
File "/home/yunus/PycharmProjects/boltz_/boltzmann-machines-clone/boltzmann_machines/dbm.py", line 877, in reconstruct
self._reconstruction = tf.get_collection('reconstruction')[0]
IndexError: list index out of range

tf.get_collection('reconstruction') returns an empty list.

when i run
dummy2 = tf.get_default_graph().get_all_collection_keys() there is no reconstruction entry.

reconstruct is the equivalent i thought but i cant get it to work.
Is there a reconstruct for RBM or how is it called?

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.