Skip to content

Commit

Permalink
minor progress..
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Oct 11, 2024
1 parent a57470d commit 59356e8
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 159 deletions.
170 changes: 85 additions & 85 deletions axon/enumgen.go

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions axon/network.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 35 additions & 35 deletions axon/network.goal
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,41 @@ func (nt *Network) NewState(ctx *Context) {
// }
}

// Cycle runs one cycle of activation updating using threading methods.
func (nt *Network) Cycle() {
// todo: chunks of 10 cycles
nix := NetIxs()
nd := int(nix.NNeurons * nix.MaxData)
ld := int(nix.NLayers * nix.MaxData)
pd := int(nix.NPools * nix.MaxData)
RunGatherSpikes(nd)
RunLayerGi(ld)
RunBetweenGi(ld)
RunPoolGi(pd)
RunCycleNeuron(nd)
RunSendSpike(nd)
RunCyclePost(ld)

// todo: fix this:
// var ldt, vta *Layer
// for _, ly := range nt.Layers {
// if ly.Type == VTALayer {
// vta = ly
// } else if ly.Type == LDTLayer {
// ldt = ly
// } else {
// ly.CyclePost(ctx)
// }
// }
// // ordering of these is important
// if ldt != nil {
// ldt.CyclePost(ctx)
// }
// if vta != nil {
// vta.CyclePost(ctx)
// }
}

//gosl:start

//////// Kernels for all parallel CPU / GPU compute are here:
Expand Down Expand Up @@ -152,41 +187,6 @@ func CyclePost(i uint32) { //gosl:kernel
Layers[li].CyclePost(ctx, di)
}

// Cycle runs one cycle of activation updating using threading methods.
func (nt *Network) Cycle() {
// todo: chunks of 10 cycles
nix := NetIxs()
nd := int(nix.NNeurons * nix.MaxData)
ld := int(nix.NLayers * nix.MaxData)
pd := int(nix.NPools * nix.MaxData)
RunGatherSpikes(nd)
RunLayerGi(ld)
RunBetweenGi(ld)
RunPoolGi(pd)
RunCycleNeuron(nd)
RunSendSpike(nd)
RunCyclePost(ld)

// todo: fix this:
// var ldt, vta *Layer
// for _, ly := range nt.Layers {
// if ly.Type == VTALayer {
// vta = ly
// } else if ly.Type == LDTLayer {
// ldt = ly
// } else {
// ly.CyclePost(ctx)
// }
// }
// // ordering of these is important
// if ldt != nil {
// ldt.CyclePost(ctx)
// }
// if vta != nil {
// vta.CyclePost(ctx)
// }
}

//gosl:end

// MinusPhase does updating after end of minus phase
Expand Down
6 changes: 6 additions & 0 deletions axon/networkbase.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions axon/networkbase.goal
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import (
// network.go has the algorithm-specific code.
// Everything is defined on Network type.

//gosl:start

// NetworkIndexes are indexes and sizes for processing network.
type NetworkIndexes struct {

Expand Down Expand Up @@ -75,6 +77,8 @@ type NetworkIndexes struct {

// total number of .Rubicon Negative USs
RubiconNNegUSs uint32 `edit:"-"`

pad uint32
}

// ItemIndex returns the main item index from an overall index over NItems * MaxData
Expand Down Expand Up @@ -113,6 +117,8 @@ func (ix *NetworkIndexes) SynIndexIsValid(si uint32) bool {
return (si < ix.NSyns)
}

//gosl:end

// axon.Network implements the Axon spiking model.
type Network struct {
emer.NetworkBase
Expand Down
1 change: 1 addition & 0 deletions axon/pool.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions axon/pool.goal
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

//gosl:start
//gosl:import "github.com/emer/axon/v2/fsfffb"

// AvgMaxPhases contains the average and maximum values over a Pool of neurons,
// at different time scales within a standard ThetaCycle of updating.
Expand Down
File renamed without changes.

0 comments on commit 59356e8

Please sign in to comment.