Skip to content

Convert From Leabra

Randall O'Reilly edited this page Nov 18, 2022 · 1 revision

Converting Existing Leabra Models to Axon

It is probably better to start with ra25 or one of the other examples and adapt the ConfigNet function from an existing leabra model, rather than directly converting the existing code, because axon uses a number of new emergent libraries (elog, estats, egui, etc) that make things more efficient.

In the name of progress and making things sensible going forward, various names have been changed to better fit the way that Axon works. This will require some renaming for existing Leabra models.

leabra -> axon

The first step is to do a global replace of leabra -> axon and Leabra -> Axon

Alpha Cycle -> Theta Cycle

The notion of the AlphaCycle as a basic unit of processing in Leabra does not quite work in Axon: it typically takes 200 msec (cycles) for a full learning cycle, corresponding to a ThetaCycle. This was actually the original idea for predictive learning, where the full processing of a given input state was supposed to take two alpha cycles = 1 theta cycle, which corresponds to the strongly-peaked duration of a single fixation in humans. In Axon, the processing of time has been generalized, so it isn't tied so specifically to a particular cycle.

The concept of a Quarter is no longer as sensible, so it has been removed. In the TimeScales enum, it is replaced with GammaCycle. There are now two more generic SpkSt1 and SpkSt2 activation state variables that can be captured at any point by calling methods of the corresponding name. ActPrv is the new name for ActQ0 and it is captured in the NewState method.

  • NewState methods are called when starting to process a new "state", which corresponds to a new fixation, a new sniff, and generally a new "trial" in standard neural network terminology.

    • AlphaCycleInit -> NewState
    • Time.AlphaCycStart -> NewState
  • The standard AlphaCyc method in your simulation should be replaced with something like ThetaCyc from the ra25 example, which contains all the new timing logic. In general, see the ra25 example for all the relevant updates.

Params

  • Prjn.WtInit -> Prjn.SWt.Init -- the spine / slow / structural wt (SWt) params control weight initialization now.

  • Prjn.WtScale -> Prjn.PrjnScale -- overall projection-level scaling has been renamed PrjnScale which better reflects its nature.

  • Prjn.Learn.Lrate -> Prjn.Learn.Lrate.Base -- added separate params for .Mod and .Sched

  • Removed: all the BCM-related AvgL mechanisms -- only using the core error-driven learning components.

Stats

SSE not used anymore -- relevant call is now PctUnitErr which returns proportion (0-1) of units that have an error (activity on wrong side of target). This is not normalized for expected activity, so in general scales with that and will tend to be rather low.

Deep

Must call ss.Net.CTCtxt() explicitly to update the CT context reps -- generally call after plus phase, but can also experiment with other timings.