Giter Site home page Giter Site logo

hnet's Introduction

Hamiltonian Networks

Copyright Brain Engineering Lab at Dartmouth. All rights reserved.

Please feel free to use this code for any non-commercial purpose under the CC Attribution-NonCommercial-ShareAlike license: https://creativecommons.org/licenses/by-nc-sa/4.0/

If you use this code, cite:

Some CLEVR-like stimuli were generated via the code available at https://github.com/DartmouthGrangerLab/custom_clevr_stimgen

Terminology

  • "edge" - 2 bits per pixel pair (just a pair of pixel values, e.g. 1-1 = both pixels are white)
  • "component" - a single set of edge states (can be represented by one composite Hamiltonian)
  • "component bank" - a set of components, stored together, sharing a graph
  • "model" - a hierarchy of component banks

types of components:

  • "connected part" - a long string of edges, like a curve
  • "group" - a set of connected part components
  • "meta" - a second tier of components
  • "meta group" - a group of meta components

Abbreviations

  • comp/cmp - component (see terminology)
  • idx - index (into another array)
  • h - hamiltonian
  • trn - training data
  • tst - testing data

Code Organization

  • common/ - lab common libraries
  • figurecode/ - functions that render results to file
  • train/ - code required exclusively for training
    • Train() - performs all training by calling other functions in the train/ folder
  • data structures
    • ComponentBank - stores one complete component bank
    • Dataset - loads whichever dataset you request, in a storage container for easy use
    • EDG - edge state enum
    • GRF - graph type enum
    • Model - stores a set of component banks, and the connections amongst them
  • Encode() - matches components against new datapoints (often calls Energy())
  • Energy() - computes the energy of each datapoint using each composite Hamiltonian
  • Main() - code entry point; loads the data, trains, tests, prints output / figures

Running the Code

Dependencies:

  • matlab (designed for matlab version r2022a), python 3
  • matlab toolboxes: Computer Vision Toolbox, Deep Learning Toolbox, Image Processing Toolbox, Statistics and Machine Learning Toolbox

Setup:

  1. Pull (or download) hnet from https://github.com/DartmouthGrangerLab/hnet
  2. Navigate matlab's working directory to ./hnet/matlab
  3. Add the hnet/matlab/* subfolders to your matlab path.
  4. to run: in matlab, execute one of the following:
    • Main("metacred", "ucicreditgerman", "tier1.memorize-->tier1.extractcorr.icacropsome.100.50.unsupsplit-->meta.extractcorr.kmeans.10.50.unsupsplit");
    • Main("groupedimg", "mnistpy.128", "connectedpart.memorize-->connectedpart.extractconnec.25-->connectedpart.transl.2");
    • Main("clevrpos1", "clevrpossimple", "tier1.memorize");

hnet's People

Contributors

efwb001 avatar jabowery avatar

Watchers

 avatar

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.