hip

package
v1.2.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: BSD-3-Clause Imports: 2 Imported by: 9

README

Hippocampus

GoDoc

Package hip provides special hippocampus algorithms for implementing the Theta-phase hippocampus model from Ketz, Morkonda, & O'Reilly (2013).

timing of ThetaPhase dynamics -- based on quarter structure:

  • Q1: ECin -> CA1 -> ECout (CA3 -> CA1 off) : ActQ1 = minus phase for auto-encoder
  • Q2,3: CA3 -> CA1 -> ECout (ECin -> CA1 off) : ActM = minus phase for recall
  • Q4: ECin -> CA1, ECin -> ECout (CA3 -> CA1 off, ECin -> CA1 on): ActP = plus phase for everything
[  q1      ][  q2  q3  ][     q4     ]
[ ------ minus ------- ][ -- plus -- ]
[   auto-  ][ recall-  ][ -- plus -- ]

  DG -> CA3 -> CA1
 /    /      /    \
[----ECin---] -> [ ECout ]

minus phase: ECout unclamped, driven by CA1
auto-   CA3 -> CA1 = 0, ECin -> CA1 = 1
recall- CA3 -> CA1 = 1, ECin -> CA1 = 0

plus phase: ECin -> ECout auto clamped
CA3 -> CA1 = 0, ECin -> CA1 = 1
(same as auto- -- training signal for CA3 -> CA1 is what EC would produce!
  • ActQ1 = auto encoder minus phase state (in both CA1 and ECout used in EcCa1Prjn as minus phase relative to ActP plus phase in CHL)
  • ActM = recall minus phase (normal minus phase dynamics for CA3 recall learning)
  • ActP = plus (serves as plus phase for both auto and recall)

learning just happens at end of trial as usual, but encoder projections use the ActQ1, ActM, ActP variables to learn on the right signals

TODO

  • try error-driven CA3 learning based on DG -> CA3 plus phase per https://arxiv.org/abs/1909.10340

  • implement a two-trial version of the code to produce a true theta rhythm integrating over two adjacent alpha trials..

Documentation

Overview

Package hip provides special hippocampus algorithms for implementing the Theta-phase hippocampus model from Ketz, Morkonda, & O'Reilly (2013).

timing of ThetaPhase dynamics -- based on quarter structure:

Q1: ECin -> CA1 -> ECout (CA3 -> CA1 off) : ActQ1 = minus phase for auto-encoder Q2,3: CA3 -> CA1 -> ECout (ECin -> CA1 off) : ActM = minus phase for recall Q4: ECin -> CA1, ECin -> ECout (CA3 -> CA1 off, ECin -> CA1 on): ActP = plus phase for everything

[ q1 ][ q2 q3 ][ q4 ] [ ------ minus ------- ][ -- plus -- ] [ auto- ][ recall- ][ -- plus -- ]

 DG -> CA3 -> CA1
/    /      /    \

[----ECin---] -> [ ECout ]

minus phase: ECout unclamped, driven by CA1 auto- CA3 -> CA1 = 0, ECin -> CA1 = 1 recall- CA3 -> CA1 = 1, ECin -> CA1 = 0

plus phase: ECin -> ECout auto clamped CA3 -> CA1 = 0, ECin -> CA1 = 1 (same as auto- -- training signal for CA3 -> CA1 is what EC would produce!

ActQ1 = auto encoder minus phase state (in both CA1 and ECout

used in EcCa1Prjn as minus phase relative to ActP plus phase in CHL)

ActM = recall minus phase (normal minus phase dynamics for CA3 recall learning) ActP = plus (serves as plus phase for both auto and recall)

learning just happens at end of trial as usual, but encoder projections use the ActQ1, ActM, ActP variables to learn on the right signals

todo: implement a two-trial version of the code to produce a true theta rhythm integrating over two adjacent alpha trials..

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CHLParams

type CHLParams struct {

	// if true, use CHL learning instead of standard XCAL learning -- allows easy exploration of CHL vs. XCAL
	On bool `desc:"if true, use CHL learning instead of standard XCAL learning -- allows easy exploration of CHL vs. XCAL"`

	// [def: 0.001] [min: 0] [max: 1] amount of hebbian learning (should be relatively small, can be effective at .0001)
	Hebb float32 `def:"0.001" min:"0" max:"1" desc:"amount of hebbian learning (should be relatively small, can be effective at .0001)"`

	// [def: 0.999] [min: 0] [max: 1] amount of error driven learning, automatically computed to be 1-Hebb
	Err float32 `def:"0.999" min:"0" max:"1" inactive:"+" desc:"amount of error driven learning, automatically computed to be 1-Hebb"`

	// if true, use ActQ1 as the minus phase -- otherwise ActM
	MinusQ1 bool `desc:"if true, use ActQ1 as the minus phase -- otherwise ActM"`

	// [def: 0.4:0.8] [min: 0] [max: 1] proportion of correction to apply to sending average activation for hebbian learning component (0=none, 1=all, .5=half, etc)
	SAvgCor float32 `` /* 161-byte string literal not displayed */

	// [def: 0.001] [min: 0] threshold of sending average activation below which learning does not occur (prevents learning when there is no input)
	SAvgThr float32 `` /* 145-byte string literal not displayed */
}

Contrastive Hebbian Learning (CHL) parameters

func (*CHLParams) DWt

func (ch *CHLParams) DWt(hebb, err float32) float32

DWt computes the overall dwt from hebbian and error terms

func (*CHLParams) Defaults

func (ch *CHLParams) Defaults()

func (*CHLParams) ErrDWt

func (ch *CHLParams) ErrDWt(sactP, sactM, ractP, ractM, linWt float32) float32

ErrDWt computes the error-driven DWt value from sending, recv acts in both phases, and linear Wt, which is used for soft weight bounding (always applied here, separate from hebbian which has its own soft weight bounding dynamic).

func (*CHLParams) HebbDWt

func (ch *CHLParams) HebbDWt(sact, ract, savgCor, linWt float32) float32

HebbDWt computes the hebbian DWt value from sending, recv acts, savgCor, and linear Wt

func (*CHLParams) MinusAct added in v1.0.1

func (ch *CHLParams) MinusAct(actM, actQ1 float32) float32

MinusAct returns the minus-phase activation to use based on settings (ActM vs. ActQ1)

func (*CHLParams) Update

func (ch *CHLParams) Update()

type CHLPrjn

type CHLPrjn struct {
	leabra.Prjn // access as .Prjn

	// [view: inline] parameters for CHL learning -- if CHL is On then WtSig.SoftBound is automatically turned off -- incompatible
	CHL CHLParams `` /* 129-byte string literal not displayed */
}

hip.CHLPrjn is a Contrastive Hebbian Learning (CHL) projection, based on basic rate-coded leabra.Prjn, that implements a pure CHL learning rule, which works better in the hippocampus.

func (*CHLPrjn) DWt

func (pj *CHLPrjn) DWt()

DWt computes the weight change (learning) -- on sending projections CHL version supported if On

func (*CHLPrjn) DWtCHL

func (pj *CHLPrjn) DWtCHL()

DWtCHL computes the weight change (learning) for CHL

func (*CHLPrjn) Defaults

func (pj *CHLPrjn) Defaults()

func (*CHLPrjn) SAvgCor

func (pj *CHLPrjn) SAvgCor(slay *leabra.Layer) float32

SAvgCor computes the sending average activation, corrected according to the SAvgCor correction factor (typically makes layer appear more sparse than it is)

func (*CHLPrjn) UpdateParams

func (pj *CHLPrjn) UpdateParams()

type EcCa1Prjn

type EcCa1Prjn struct {
	leabra.Prjn // access as .Prjn
}

hip.EcCa1Prjn is for EC <-> CA1 projections, to perform error-driven learning of this encoder pathway according to the ThetaPhase algorithm uses Contrastive Hebbian Learning (CHL) on ActP - ActQ1 Q1: ECin -> CA1 -> ECout : ActQ1 = minus phase for auto-encoder Q2, 3: CA3 -> CA1 -> ECout : ActM = minus phase for recall Q4: ECin -> CA1, ECin -> ECout : ActP = plus phase for everything

func (*EcCa1Prjn) DWt

func (pj *EcCa1Prjn) DWt()

DWt computes the weight change (learning) -- on sending projections Delta version

func (*EcCa1Prjn) Defaults

func (pj *EcCa1Prjn) Defaults()

func (*EcCa1Prjn) UpdateParams

func (pj *EcCa1Prjn) UpdateParams()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL