Hopfield network emulator usage

From OpenCog
Jump to: navigation, search

To get a list of options type hopfield --help. They are divided into sections, "Mode", "Output", "Network", "Dynamics", and "Pattern commands". We'll explore each of the sections in turn.

Mode options

  [none]        Default mode is to imprint, test and repeat.
  -R --reset    Same as above mode, but completely reset the network between
                each imprint and test.
  -i --interleave <N> Interleave training of each pattern. With N spacing
                between imprinting start.
  -P --palimpsest <N> Palimpsest training with N % tolerance

What training and testing scheme to use (see Hopfield_network_emulator#Learning modes). By default it imprints a pattern for N cycles, then retrieves it, then moves on and does the same for the next pattern. The '-R' option is the same, but resets the links between each pattern. '-P' follows the palimpsest learning scheme used by Storkey.

Output options

  -v, --verbose         Set to verbose output (log level "DEBUG")
  -d, --debug           Set debug output, traces dynamics (log level "FINE")
  -m --show-matrix      Show matrices of stored/cue/retrieved pattern at end.
  -o --total            Report the mean performance increase between cue and retrieval.
  -a --log-performance [prefix] log the change cue/retrieval/diff similarity to
                        separate files, optionally beginning with [prefix].
     --result-file <x>          output retrieved patterns to this file.
  -C --show-config      Print configuration based on options to stdout and exit.

-v and -d give different levels of logging. Note that -d is EXTREMELY verbose so that a networks behaviour can be closely examined.

-m will print out the pattern retrieved after each cycle.


  -w --width N          Set width of Hopfield network
  -h --height N         Set height of Hopfield network
  -n --size N           Set width and height of Hopfield network to N
  -l --links N          Add N random Hebbian links to network
  -d --density N        Set the number of links to a ratio of the total possible links
                          numLinks = density *  sum(1:(( width * height ) - 1 ))


  -s --stimulus N       Amount of stimulus to give an atom during imprinting or retrieval
  -f --focus N          Attentional focus boundary.
  -z --viz-threshold N  The atom STI needed for an atom to be considered "on" when
                          compared to original stored pattern.
  -c --imprint N        Number of cycles to imprint pattern.
  -r --retrieve N       Number of cycles to retrieve pattern for.
  -t --spread-threshold N  The minimum threshold of atom STI before it gets spread.
  -q --spread-multiplier N  multiplier for importance spread, if 0 then evenly
                        spread across links.

Pattern commands

  -p --patterns N       Number of patterns to test.
  -g --gen-density N    Density of generated patterns (active/inactive nodes).
  -e --error N          Probability of error (if N < 1) in each bit of cue 
                        pattern or number of bit errors (if N > 1) in cue
  -E --one-cue          Only generate a cue file once for a pattern and reuse it.
     --train-file <x>   load patterns from file, must use -n to specify pattern size.
     --cue-file <x>     load patterns from file, must use -n to specify pattern size.