forked from emer/leabra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pbwm.go
44 lines (33 loc) · 1.46 KB
/
pbwm.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2019, The Emergent Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package pbwm
import (
"github.com/ccnlab/leabrax/leabra"
)
// PBWMLayer defines the essential algorithmic API for PBWM at the layer level.
// Builds upon the leabra.LeabraLayer API
type PBWMLayer interface {
leabra.LeabraLayer
// AsPBWM returns this layer as a pbwm.Layer (base Layer in PBWM)
AsPBWM() *Layer
// AsGate returns this layer as a pbwm.GateLayer (gated layer type) -- nil if not impl
AsGate() *GateLayer
// UnitValByIdx returns value of given PBWM-specific variable by variable index
// and flat neuron index (from layer or neuron-specific one).
UnitValByIdx(vidx NeurVars, idx int) float32
// GateSend updates gating state and sends it along to other layers.
// Called after std Cycle methods.
// Only implemented for gating layers.
GateSend(ltime *leabra.Time)
// RecGateAct records the gating activation from current activation, when gating occcurs
// based on GateState.Now
RecGateAct(ltime *leabra.Time)
// SendMods is called at end of Cycle to send modulator signals (DA, etc)
// which will then be active for the next cycle of processing
SendMods(ltime *leabra.Time)
// Quarter2DWt is optional Q2 DWt -- PFC and matrix layers can do this as appropriate
Quarter2DWt()
// DoQuarter2DWt returns true if this recv layer should have its weights updated
DoQuarter2DWt() bool
}