-
Notifications
You must be signed in to change notification settings - Fork 24
/
typegen.go
31 lines (17 loc) · 12.7 KB
/
typegen.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
// Code generated by "core generate -add-types"; DO NOT EDIT.
package env
import (
"cogentcore.org/core/types"
)
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.Counter", IDName: "counter", Doc: "Counter is a counter that counts increments at a given time scale.\nIt keeps track of when it has been incremented or not, and\nretains the previous value.", Fields: []types.Field{{Name: "Cur", Doc: "current counter value"}, {Name: "Prv", Doc: "previous counter value, prior to last Incr() call (init to -1)"}, {Name: "Chg", Doc: "did this change on the last Step() call or not?"}, {Name: "Max", Doc: "where relevant, this is a fixed maximum counter value, above which the counter will reset back to 0 -- only used if > 0"}, {Name: "Scale", Doc: "the unit of time scale represented by this counter (just FYI)"}}})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.Counters", IDName: "counters", Doc: "Counters contains an ordered slice of timescales,\nand a lookup map of counters by timescale\nused to manage counters in the Env.", Fields: []types.Field{{Name: "Order", Doc: "ordered list of the counter timescales, from outer-most (highest) to inner-most (lowest)"}, {Name: "Counters", Doc: "map of the counters by timescale"}}})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.CurPrvF32", IDName: "cur-prv-f32", Doc: "CurPrvF32 is basic state management for current and previous values, float32 values", Fields: []types.Field{{Name: "Cur", Doc: "current value"}, {Name: "Prv", Doc: "previous value"}}})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.CurPrvInt", IDName: "cur-prv-int", Doc: "CurPrvInt is basic state management for current and previous values, int values", Fields: []types.Field{{Name: "Cur", Doc: "current value"}, {Name: "Prv", Doc: "previous value"}}})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.CurPrvString", IDName: "cur-prv-string", Doc: "CurPrvString is basic state management for current and previous values, string values", Fields: []types.Field{{Name: "Cur", Doc: "current value"}, {Name: "Prv", Doc: "previous value"}}})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.Element", IDName: "element", Doc: "Element specifies one element of State or Action in an environment", Fields: []types.Field{{Name: "Name", Doc: "name of this element -- must be unique"}, {Name: "Shape", Doc: "shape of the tensor for this element -- each element should generally have a well-defined consistent shape to enable the model to process it consistently"}, {Name: "DimNames", Doc: "names of the dimensions within the Shape -- optional but useful for ensuring correct usage"}}})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.Elements", IDName: "elements", Doc: "Elements is a list of Element info"})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.Env", IDName: "env", Doc: "Env defines an interface for environments, which determine the nature and\nsequence of States that can be used as inputs to a model, and the Env\nalso can accept Action responses from the model that affect state evolution.\n\nThe Env manages [Counter] values to advance the temporal state of the\nenvironment, using [etime.Times] standard intervals.\n\nState is comprised of one or more Elements, each of which consists of an\ntensor.Tensor chunk of values that can be obtained by the model.\nLikewise, Actions can also have Elements. The Step method is the main\ninterface for advancing the Env state. Counters should be queried\nafter calling Step to see if any relevant values have changed, to trigger\nfunctions in the model (e.g., logging of prior statistics, etc).\n\nTypically each specific implementation of this Env interface will have\nmultiple parameters etc that can be modified to control env behavior --\nall of this is paradigm-specific and outside the scope of this basic interface.", Directives: []types.Directive{{Tool: "go", Directive: "generate", Args: []string{"core", "generate", "-add-types"}}}, Methods: []types.Method{{Name: "Init", Doc: "Init initializes the environment for a given run of the model.\nThe environment may not care about the run number, but may implement\ndifferent parameterizations for different runs (e.g., between-subject\nmanipulations). In general the Env can expect that the model will likely\nhave established a different random seed per run, prior to calling this\nmethod, and that may be sufficient to enable different run-level behavior.\nAll other initialization / updating beyond this outer-most Run level must\nbe managed internally by the Env itself, and the model can query the\nCounter state information to determine when things have updated at different\ntime scales. See Step() for important info about state of env after Init\nbut prior to first Step() call.", Args: []string{"run"}}, {Name: "Step", Doc: "Step generates the next step of environment state.\nThis is the main API for how the model interacts with the environment.\nThe env should update all other levels of state internally over\nrepeated calls to the Step method.\nIf there are no further inputs available, it returns false (most envs\ntypically only return true and just continue running as long as needed).\n\nThe Env thus always reflects the *current* state of things, and this\ncall increments that current state, such that subsequent calls to\nState() will return this current state.\n\nThis implies that the state just after Init and prior to first Step\ncall should be an *initialized* state that then allows the first Step\ncall to establish the proper *first* state. Typically this means that\none or more counters will be set to -1 during Init and then get incremented\nto 0 on the first Step call.", Returns: []string{"bool"}}, {Name: "State", Doc: "State returns the given element's worth of tensor data from the environment\nbased on the current state of the env, as a function of having called Step().\nIf no output is available on that element, then nil is returned.\nThe returned tensor must be treated as read-only as it likely points to original\nsource data -- please make a copy before modifying (e.g., Clone() methdod).", Args: []string{"element"}, Returns: []string{"Tensor"}}, {Name: "Action", Doc: "Action sends tensor data about e.g., responses from model back to act\non the environment and influence its subsequent evolution.\nThe nature and timing of this input is paradigm dependent.", Args: []string{"element", "input"}}}})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.Envs", IDName: "envs", Doc: "Envs is a map of environments organized according\nto the evaluation mode string (recommended key value)"})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.FixedTable", IDName: "fixed-table", Doc: "FixedTable is a basic Env that manages patterns from an table.Table, with\neither sequential or permuted random ordering, with the Trial counters\nto record progress and iterations through the table.\nIt uses an IndexView indexed view of the Table, so a single shared table\ncan be used across different environments, with each having its own unique view.", Fields: []types.Field{{Name: "Name", Doc: "name of this environment, usually Train vs. Test."}, {Name: "Table", Doc: "this is an indexed view of the table with the set of patterns to output.\nThe indexes are used for the *sequential* view so you can easily\nsort / split / filter the patterns to be presented using this view.\nThis adds the random permuted Order on top of those if !sequential."}, {Name: "Sequential", Doc: "present items from the table in sequential order (i.e., according to\nthe indexed view on the Table)? otherwise permuted random order."}, {Name: "Order", Doc: "permuted order of items to present if not sequential.\nupdated every time through the list."}, {Name: "Trial", Doc: "current ordinal item in Table. if Sequential then = row number in table,\notherwise is index in Order list that then gives row number in Table."}, {Name: "TrialName", Doc: "if Table has a Name column, this is the contents of that."}, {Name: "GroupName", Doc: "if Table has a Group column, this is contents of that."}, {Name: "NameCol", Doc: "name of the Name column -- defaults to 'Name'."}, {Name: "GroupCol", Doc: "name of the Group column -- defaults to 'Group'."}}})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.FreqTable", IDName: "freq-table", Doc: "FreqTable is an Env that manages patterns from an table.Table with frequency\ninformation so that items are presented according to their associated frequencies\nwhich are effectively probabilities of presenting any given input -- must have\na Freq column with these numbers in the table (actual col name in FreqCol).\nEither sequential or permuted random ordering is supported, with std Trial / Epoch\nTimeScale counters to record progress and iterations through the table.\nIt also records the outer loop of Run as provided by the model.\nIt uses an IndexView indexed view of the Table, so a single shared table\ncan be used across different environments, with each having its own unique view.", Fields: []types.Field{{Name: "Name", Doc: "name of this environment"}, {Name: "Table", Doc: "this is an indexed view of the table with the set of patterns to output -- the indexes are used for the *sequential* view so you can easily sort / split / filter the patterns to be presented using this view -- we then add the random permuted Order on top of those if !sequential"}, {Name: "NSamples", Doc: "number of samples to use in constructing the list of items to present according to frequency -- number per epoch ~ NSamples * Freq -- see RandSamp option"}, {Name: "RandSamp", Doc: "if true, use random sampling of items NSamples times according to given Freq probability value -- otherwise just directly add NSamples * Freq items to the list"}, {Name: "Sequential", Doc: "present items from the table in sequential order (i.e., according to the indexed view on the Table)? otherwise permuted random order. All repetitions of given item will be sequential if Sequential"}, {Name: "Order", Doc: "list of items to present, with repetitions -- updated every time through the list"}, {Name: "Trial", Doc: "current ordinal item in Table -- if Sequential then = row number in table, otherwise is index in Order list that then gives row number in Table"}, {Name: "TrialName", Doc: "if Table has a Name column, this is the contents of that"}, {Name: "GroupName", Doc: "if Table has a Group column, this is contents of that"}, {Name: "NameCol", Doc: "name of the Name column -- defaults to 'Name'"}, {Name: "GroupCol", Doc: "name of the Group column -- defaults to 'Group'"}, {Name: "FreqCol", Doc: "name of the Freq column -- defaults to 'Freq'"}}})
var _ = types.AddType(&types.Type{Name: "github.com/emer/emergent/v2/env.MPIFixedTable", IDName: "mpi-fixed-table", Doc: "MPIFixedTable is an MPI-enabled version of the FixedTable, which is\na basic Env that manages patterns from an table.Table, with\neither sequential or permuted random ordering, and uses standard Trial\nTime counter to record iterations through the table.\nIt uses an IndexView indexed view of the Table, so a single shared table\ncan be used across different environments, with each having its own unique view.\nThe MPI version distributes trials across MPI procs, in the Order list.\nIt is ESSENTIAL that the number of trials (rows) in Table is\nevenly divisible by number of MPI procs!\nIf all nodes start with the same seed, it should remain synchronized.", Fields: []types.Field{{Name: "Name", Doc: "name of this environment"}, {Name: "Table", Doc: "this is an indexed view of the table with the set of patterns to output -- the indexes are used for the *sequential* view so you can easily sort / split / filter the patterns to be presented using this view -- we then add the random permuted Order on top of those if !sequential"}, {Name: "Sequential", Doc: "present items from the table in sequential order (i.e., according to the indexed view on the Table)? otherwise permuted random order"}, {Name: "Order", Doc: "permuted order of items to present if not sequential -- updated every time through the list"}, {Name: "Trial", Doc: "current ordinal item in Table -- if Sequential then = row number in table, otherwise is index in Order list that then gives row number in Table"}, {Name: "TrialName", Doc: "if Table has a Name column, this is the contents of that"}, {Name: "GroupName", Doc: "if Table has a Group column, this is contents of that"}, {Name: "NameCol", Doc: "name of the Name column -- defaults to 'Name'"}, {Name: "GroupCol", Doc: "name of the Group column -- defaults to 'Group'"}, {Name: "TrialSt", Doc: "for MPI, trial we start each epoch on, as index into Order"}, {Name: "TrialEd", Doc: "for MPI, trial number we end each epoch before (i.e., when ctr gets to Ed, restarts)"}}})