elog

package
v1.1.52 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: BSD-3-Clause Imports: 15 Imported by: 27

README

Docs: GoDoc

elog provides a full infrastructure for recording data of all sorts at multiple time scales and evaluation modes (training, testing, validation, etc).

The elog.Item provides a full definition of each distinct item that is logged with a map of Write functions keyed by a scope string that reflects the time scale and mode. The same function can be used across multiple scopes, or a different function for each scope, etc.

The Items are written to the table in the order added, so you can take advantage of previously-computed item values based on the actual ordering of item code. For example, intermediate values can be stored / retrieved from Stats, or from other items on a log, e.g., using Context.LogItemFloat function.

The Items are then processed in CreateTables() to create a set of etable.Table tables to hold the data.

The elog.Logs struct holds all the relevant data and functions for managing the logging process.

  • Log(mode, time) does logging, adding a new row

  • LogRow(mode, time, row) does logging at given row

Both of these functions automatically write incrementally to a tsv File if it has been opened.

The Context object is passed to the Item Write functions, and has all the info typically needed -- must call SetContext(stats, net) on the Logs to provide those elements. Write functions can do most standard things by calling methods on Context -- see that in Docs above for more info.

Scopes

Everything is organized according to a ScopeKey, which is just a string, that is formatted to represent two factors: an evaluation mode (standard versions defined by EvalModes enum) and a time scale (Times enum).

Standard EvalModes are:

  • Train
  • Test
  • Validate

Standard Times are based on the Env TimeScales augmented with Leabra / Axon finer-grained scales, including:

  • Cycle
  • Trial
  • Epoch
  • Run

Other arbitrary scope values can be used -- there are Scope versions of every method that take an arbitrary ScopeKey that can be composed using the ScopeStr method from any two strings, along with the "plain" versions of these methods that take the standard mode and time enums for convenience. These enums can themselves also be extended but it is probably easier to just use strings.

Documentation

Index

Constants

View Source
const LogPrec = 4

LogPrec is precision for saving float values in logs

Variables

View Source
var (
	ScopeKeySeparator = "&" // between mode and time
	ScopeKeyList      = "|" // between multiple modes, times
)

Like "Train|Test&Epoch|Trial"

View Source
var KiT_EvalModes = kit.Enums.AddEnum(EvalModesN, kit.NotBitFlag, nil)
View Source
var KiT_Times = kit.Enums.AddEnum(TimesN, kit.NotBitFlag, nil)

Functions

func ScopeName

func ScopeName(mode EvalModes, time Times) string

ScopeName generates a string name as just the concatenation of mode + time e.g., used for naming log tables

Types

type Context

type Context struct {
	Logs     *Logs         `desc:"pointer to the Logs object with all log data"`
	Stats    *estats.Stats `desc:"pointer to stats"`
	Net      emer.Network  `desc:"network"`
	Item     *Item         `desc:"current log Item"`
	Scope    ScopeKey      `desc:"current scope key"`
	Mode     EvalModes     `desc:"current scope eval mode (if standard)"`
	Time     Times         `desc:"current scope timescale (if standard)"`
	LogTable *LogTable     `desc:"LogTable with extra data for the table"`
	Table    *etable.Table `desc:"current table to record value to"`
	Row      int           `desc:"current row in table to write to"`
}

Context provides the context for logging Write functions. SetContext must be called on Logs to set the Stats and Net values Provides various convenience functions for setting log values and other commonly-used operations.

func (*Context) ClosestPat

func (ctx *Context) ClosestPat(layNm, unitVar string, pats *etable.Table, colnm, namecol string) (int, float32, string)

ClosestPat finds the closest pattern in given column of given pats table to given layer activation pattern using given variable. Returns the row number, correlation value, and value of a column named namecol for that row if non-empty. Column must be etensor.Float32

func (*Context) ItemFloat

func (ctx *Context) ItemFloat(mode EvalModes, time Times, itemNm string) float64

ItemFloat returns a float64 value of the last row of given item name in log for given mode, time

func (*Context) ItemFloatScope

func (ctx *Context) ItemFloatScope(scope ScopeKey, itemNm string) float64

ItemFloatScope returns a float64 value of the last row of given item name in log for given scope.

func (*Context) ItemString

func (ctx *Context) ItemString(mode EvalModes, time Times, itemNm string) string

ItemString returns a string value of the last row of given item name in log for given mode, time

func (*Context) ItemStringScope

func (ctx *Context) ItemStringScope(scope ScopeKey, itemNm string) string

ItemStringScope returns a string value of the last row of given item name in log for given scope.

func (*Context) LastNRows

func (ctx *Context) LastNRows(mode EvalModes, time Times, n int) *etable.IdxView

LastNRows returns an IdxView onto table for given scope with the last n rows of the table (only valid rows, if less than n). This index view is available later with the "LastNRows" name via NamedIdxView functions.

func (*Context) LastNRowsScope

func (ctx *Context) LastNRowsScope(sk ScopeKey, n int) *etable.IdxView

LastNRowsScope returns an IdxView onto table for given scope with the last n rows of the table (only valid rows, if less than n). This index view is available later with the "LastNRows" name via NamedIdxView functions.

func (*Context) Layer

func (ctx *Context) Layer(layNm string) emer.Layer

Layer returns layer by name as the emer.Layer interface -- you may then need to convert to a concrete type depending.

func (*Context) SetAgg

func (ctx *Context) SetAgg(mode EvalModes, time Times, ag agg.Aggs) float64

SetAgg sets an aggregated scalar value computed from given eval mode and time scale with same Item name, to current item, row. returns aggregated value

func (*Context) SetAggItem

func (ctx *Context) SetAggItem(mode EvalModes, time Times, itemNm string, ag agg.Aggs) float64

SetAggItem sets an aggregated scalar value computed from given eval mode and time scale with given Item name, to current item, row. returns aggregated value

func (*Context) SetAggItemScope

func (ctx *Context) SetAggItemScope(scope ScopeKey, itemNm string, ag agg.Aggs) float64

SetAggItemScope sets an aggregated scalar value computed from another scope (ScopeKey) with given Item name, to current item, row. returns aggregated value

func (*Context) SetAggScope

func (ctx *Context) SetAggScope(scope ScopeKey, ag agg.Aggs) float64

SetAggScope sets an aggregated scalar value computed from another scope (ScopeKey) with same Item name, to current item, row returns aggregated value

func (*Context) SetFloat32

func (ctx *Context) SetFloat32(val float32)

SetFloat32 sets a float32 to current table, item, row

func (*Context) SetFloat64

func (ctx *Context) SetFloat64(val float64)

SetFloat64 sets a float64 to current table, item, row

func (*Context) SetInt

func (ctx *Context) SetInt(val int)

SetInt sets an int to current table, item, row

func (*Context) SetLayerTensor

func (ctx *Context) SetLayerTensor(layNm, unitVar string) *etensor.Float32

SetLayerTensor sets tensor of Unit values on a layer for given variable

func (*Context) SetStatFloat

func (ctx *Context) SetStatFloat(name string)

SetStatFloat sets a Stats Float of given name to current table, item, row

func (*Context) SetStatInt

func (ctx *Context) SetStatInt(name string)

SetStatInt sets a Stats int of given name to current table, item, row

func (*Context) SetStatString

func (ctx *Context) SetStatString(name string)

SetStatString sets a Stats string of given name to current table, item, row

func (*Context) SetString

func (ctx *Context) SetString(val string)

SetString sets a string to current table, item, row

func (*Context) SetTable

func (ctx *Context) SetTable(sk ScopeKey, lt *LogTable, row int)

SetTable sets the current table & scope -- called by WriteItems

func (*Context) SetTensor

func (ctx *Context) SetTensor(val etensor.Tensor)

SetTensor sets a Tensor to current table, item, row

type DefaultBool

type DefaultBool int64
const (
	DUnknown DefaultBool = iota
	DTrue
	DFalse
)

func (*DefaultBool) ToBool

func (db *DefaultBool) ToBool() bool

type EvalModes

type EvalModes int32

EvalModes the mode enum

const (
	NoEvalMode EvalModes = iota

	// AllModes indicates that the log should occur over all modes present in other items.
	AllModes

	// Train is this a training mode for the env
	Train

	// Test is this a test mode for the env
	Test

	// Validate is this a validation mode for the env
	Validate

	// Analyze when analyzing the representations and behavior of the network
	Analyze

	EvalModesN
)

The evaluation modes

func (*EvalModes) FromString

func (i *EvalModes) FromString(s string) error

func (EvalModes) MarshalJSON

func (ev EvalModes) MarshalJSON() ([]byte, error)

func (EvalModes) String

func (i EvalModes) String() string

func (*EvalModes) UnmarshalJSON

func (ev *EvalModes) UnmarshalJSON(b []byte) error

type Item

type Item struct {
	Name      string       `desc:"name of column -- must be unique for a table"`
	Type      etensor.Type `desc:"data type, using etensor types which are isomorphic with arrow.Type"`
	CellShape []int        `` /* 168-byte string literal not displayed */
	DimNames  []string     `desc:"names of the dimensions within the CellShape -- 'Row' will be added to outer dimension"`
	Write     WriteMap     `` /* 263-byte string literal not displayed */
	Plot      DefaultBool  `desc:"Whether or not to plot it"`
	Range     minmax.F64   `desc:"The minimum and maximum values, for plotting"`
	FixMin    DefaultBool  `desc:"Whether to fix the minimum in the display"`
	FixMax    DefaultBool  `desc:"Whether to fix the maximum in the display"`

	// following are updated in final Process step
	Modes map[string]bool `desc:"map of eval modes that this item has a Write function for"`
	Times map[string]bool `desc:"map of times that this item has a Write function for"`
}

Item describes one item to be logged -- has all the info for this item, across all scopes where it is relevant.

func (*Item) CompileScopes

func (item *Item) CompileScopes()

CompileScopes compiles maps of modes and times where this item appears. Based on the final updated Write map

func (*Item) HasMode

func (item *Item) HasMode(mode EvalModes) bool

func (*Item) HasTime

func (item *Item) HasTime(time Times) bool

func (*Item) SetEachScopeKey

func (item *Item) SetEachScopeKey()

SetEachScopeKey updates the Write map so that it only contains entries for a unique Mode,Time pair, where multiple modes and times may have originally been specified.

func (*Item) SetWriteFunc

func (item *Item) SetWriteFunc(mode EvalModes, time Times, theFunc WriteFunc)

SetWriteFunc sets Write function for one mode, time

func (*Item) SetWriteFuncAll

func (item *Item) SetWriteFuncAll(theFunc WriteFunc)

SetWriteFuncAll sets the Write function for all existing Modes and Times Can be used to replace a Write func after the fact.

func (*Item) SetWriteFuncOver

func (item *Item) SetWriteFuncOver(modes []EvalModes, times []Times, theFunc WriteFunc)

SetWriteFuncOver sets the Write function over range of modes and times

func (*Item) WriteFunc

func (item *Item) WriteFunc(mode, time string) (WriteFunc, bool)

type LogTable

type LogTable struct {
	Table        *etable.Table              `desc:"Actual data stored."`
	Meta         map[string]string          `desc:"arbitrary meta-data for each table, e.g., hints for plotting: Plot = false to not plot, XAxisCol, LegendCol"`
	IdxView      *etable.IdxView            `view:"-" desc:"Index View of the table -- automatically updated when a new row of data is logged to the table."`
	NamedViews   map[string]*etable.IdxView `` /* 196-byte string literal not displayed */
	File         *os.File                   `view:"-" desc:"File to store the log into."`
	WroteHeaders bool                       `view:"-" desc:"true if headers for File have already been written"`
}

LogTable contains all the data for one log table

func NewLogTable

func NewLogTable(table *etable.Table) *LogTable

NewLogTable returns a new LogTable entry for given table, initializing values

func (*LogTable) GetIdxView

func (lt *LogTable) GetIdxView() *etable.IdxView

GetIdxView returns the index view for the whole table. It is reset to nil after log row is written, and if nil then it is initialized to reflect current rows.

func (*LogTable) NamedIdxView

func (lt *LogTable) NamedIdxView(name string) (*etable.IdxView, bool)

NamedIdxView returns a named Index View of the table, and true if this index view was newly created to show entire table (else false). This is used for additional data aggregation, filtering etc. It is reset to nil after log row is written, and if nil then it is initialized to reflect current rows as a starting point (returning true). Thus, the bool return value can be used for re-using cached indexes.

func (*LogTable) ResetIdxViews

func (lt *LogTable) ResetIdxViews()

ResetIdxViews resets all IdxViews -- after log row is written

type Logs

type Logs struct {
	Tables     map[ScopeKey]*LogTable   `desc:"Tables storing log data, auto-generated from Items."`
	MiscTables map[string]*etable.Table `desc:"holds additional tables not computed from items -- e.g., aggregation results, intermediate computations, etc"`

	Items      []*Item         `` /* 167-byte string literal not displayed */
	Context    Context         `` /* 171-byte string literal not displayed */
	Modes      map[string]bool `view:"-" desc:"All the eval modes that appear in any of the items of this log."`
	Times      map[string]bool `view:"-" desc:"All the timescales that appear in any of the items of this log."`
	ItemIdxMap map[string]int  `view:"-" desc:"map of item indexes by name, for rapid access to items if they need to be modified after adding."`
	TableOrder []ScopeKey      `view:"-" desc:"sorted order of table scopes"`
}

Logs contains all logging state and API for doing logging. do AddItem to add any number of items, at different eval mode, time scopes. Each Item has its own Write functions, at each scope as neeeded. Then call CreateTables to generate log Tables from those items. Call Log with a scope to add a new row of data to the log and ResetLog to reset the log to empty.

func (*Logs) AddItem

func (lg *Logs) AddItem(item *Item)

AddItem adds an item to the list. The items are stored in the order they are added, and this order is used for calling the item Write functions, so you can rely on that ordering for any sequential dependencies across items (e.g., in using intermediate computed values). Note: item names must be unique -- use different scopes for Write functions where needed.

func (*Logs) CloseLogFiles

func (lg *Logs) CloseLogFiles()

CloseLogFiles closes all open log files

func (*Logs) CompileAllScopes

func (lg *Logs) CompileAllScopes()

CompileAllScopes gathers all the modes and times used across all items

func (*Logs) CreateTables

func (lg *Logs) CreateTables() error

CreateTables creates the log tables based on all the specified log items It first calls ProcessItems to instantiate specific scopes.

func (*Logs) IdxView

func (lg *Logs) IdxView(mode EvalModes, time Times) *etable.IdxView

IdxView returns the Index View of a log table for a given mode, time This is used for data aggregation functions over the entire table. It should not be altered (don't Filter!) and always shows the whole table. See NamedIdxView for custom index views.

func (*Logs) IdxViewScope

func (lg *Logs) IdxViewScope(sk ScopeKey) *etable.IdxView

IdxViewScope returns the Index View of a log table for given ScopeKey This is used for data aggregation functions over the entire table. This view should not be altered and always shows the whole table. See NamedIdxView for custom index views.

func (*Logs) ItemBindAllScopes

func (lg *Logs) ItemBindAllScopes(item *Item)

ItemBindAllScopes translates the AllModes or AllTimes scopes into a concrete list of actual Modes and Times used across all items

func (*Logs) Log

func (lg *Logs) Log(mode EvalModes, time Times) *etable.Table

Log performs logging for given mode, time. Adds a new row and Writes all the items. and saves data to file if open.

func (*Logs) LogRow

func (lg *Logs) LogRow(mode EvalModes, time Times, row int) *etable.Table

LogRow performs logging for given mode, time, at given row. Saves data to file if open.

func (*Logs) LogRowScope

func (lg *Logs) LogRowScope(sk ScopeKey, row int) *etable.Table

LogRowScope performs logging for given ScopeKey, at given row. Saves data to file if open.

func (*Logs) LogScope

func (lg *Logs) LogScope(sk ScopeKey) *etable.Table

LogScope performs logging for given ScopeKey Adds a new row and Writes all the items. and saves data to file if open.

func (*Logs) MiscTable

func (lg *Logs) MiscTable(name string) *etable.Table

MiscTable gets a miscellaneous table that is not specified or typically expected

func (*Logs) NamedIdxView

func (lg *Logs) NamedIdxView(mode EvalModes, time Times, name string) (*etable.IdxView, bool)

NamedIdxView returns a named Index View of a log table for a given mode, time. This is used for additional data aggregation, filtering etc. When accessing the first time during writing a new row of the log, it automatically shows a view of the entire table and returns true for 2nd arg. You can then filter, sort, etc as needed. Subsequent calls within same row Write will return the last filtered view, and false for 2nd arg -- can then just reuse view.

func (*Logs) NamedIdxViewScope

func (lg *Logs) NamedIdxViewScope(sk ScopeKey, name string) (*etable.IdxView, bool)

NamedIdxView returns a named Index View of a log table for a given mode, time. This is used for additional data aggregation, filtering etc. When accessing the first time during writing a new row of the log, it automatically shows a view of the entire table and returns true for 2nd arg. You can then filter, sort, etc as needed. Subsequent calls within same row Write will return the last filtered view, and false for 2nd arg -- can then just reuse view.

func (*Logs) NewTable

func (lg *Logs) NewTable(mode, time string) *etable.Table

NewTable returns a new table configured for given mode, time scope

func (*Logs) NoPlot

func (lg *Logs) NoPlot(mode EvalModes, time Times)

NoPlot sets meta data to not plot for given scope mode, time. Typically all combinations of mode and time end up being generated, so you have to turn off plotting of cases not used.

func (*Logs) NoPlotScope

func (lg *Logs) NoPlotScope(sk ScopeKey)

NoPlotScope sets meta data to not plot for given scope mode, time. Typically all combinations of mode and time end up being generated, so you have to turn off plotting of cases not used.

func (*Logs) ProcessItems

func (lg *Logs) ProcessItems()

ProcessItems is called in CreateTables, after all items have been added. It instantiates All scopes, and compiles multi-list scopes into single mode, item pairs

func (*Logs) ResetLog

func (lg *Logs) ResetLog(mode EvalModes, time Times)

ResetLog resets the log for given mode, time, at given row. by setting number of rows = 0

func (*Logs) SetContext

func (lg *Logs) SetContext(stats *estats.Stats, net emer.Network)

SetContext sets the Context for logging Write functions to give general access to the stats and network

func (*Logs) SetLogFile

func (lg *Logs) SetLogFile(mode EvalModes, time Times, fnm string)

SetLogFile sets the log filename for given scope

func (*Logs) SetMeta

func (lg *Logs) SetMeta(mode EvalModes, time Times, key, val string)

SetMeta sets table meta data for given scope mode, time.

func (*Logs) SetMetaScope

func (lg *Logs) SetMetaScope(sk ScopeKey, key, val string)

SetMetaScope sets table meta data for given scope

func (*Logs) Table

func (lg *Logs) Table(mode EvalModes, time Times) *etable.Table

Table returns the table for given mode, time

func (*Logs) TableDetails

func (lg *Logs) TableDetails(mode EvalModes, time Times) *LogTable

TableDetails returns the LogTable record of associated info for given table

func (*Logs) TableDetailsScope

func (lg *Logs) TableDetailsScope(sk ScopeKey) *LogTable

TableDetailsScope returns the LogTable record of associated info for given table

func (*Logs) TableScope

func (lg *Logs) TableScope(sk ScopeKey) *etable.Table

TableScope returns the table for given ScopeKey

func (*Logs) WriteItems

func (lg *Logs) WriteItems(sk ScopeKey, row int)

WriteItems calls all item Write functions within given scope providing the relevant Context for the function. Items are processed in the order added, to enable sequential dependencies to be used.

func (*Logs) WriteLastRowToFile

func (lg *Logs) WriteLastRowToFile(lt *LogTable)

WriteLastRowToFile writes the last row of table to file, if File != nil

type ScopeKey

type ScopeKey string

ScopeKey the associated string representation of a scope or scopes. They include one or more EvalModes and one or more Times. It is fully extensible with arbitrary mode and time strings -- the enums are a convenience for standard cases. Ultimately a single mode, time pair is used concretely, but the All* cases and lists of multiple can be used as a convenience to specify ranges

func Scope

func Scope(mode EvalModes, time Times) ScopeKey

Scope generates a scope key string from one mode and time

func ScopeStr

func ScopeStr(mode, time string) ScopeKey

ScopeStr generates a scope key string from string values for mode, time

func Scopes

func Scopes(modes []EvalModes, times []Times) ScopeKey

Scopes generates a scope key string from multiple modes, times

func ScopesMap

func ScopesMap(modes, times map[string]bool) ScopeKey

ScopesMap generates a scope key from maps of modes and times (warning: ordering is random!)

func ScopesStr

func ScopesStr(modes, times []string) ScopeKey

ScopesStr generates a scope key string from multiple modes, times

func SortScopes

func SortScopes(scopes []ScopeKey) []ScopeKey

SortScopes sorts a list of concrete mode, time scopes according to the EvalModes and Times enum ordering

func (*ScopeKey) FromScope

func (sk *ScopeKey) FromScope(mode EvalModes, time Times)

FromScope create an associated scope from given standard mode and time

func (*ScopeKey) FromScopeStr

func (sk *ScopeKey) FromScopeStr(mode, time string)

FromScopeStr create an associated scope from given mode and time as strings

func (*ScopeKey) FromScopes

func (sk *ScopeKey) FromScopes(modes []EvalModes, times []Times)

FromScopes creates an associated scope merging the modes and times that are specified If you modify this, also modify ModesAndTimes, below.

func (*ScopeKey) FromScopesMap

func (sk *ScopeKey) FromScopesMap(modes, times map[string]bool)

FromScopesMap creates an associated scope key merging the modes and times that are specified by map of strings.

func (*ScopeKey) FromScopesStr

func (sk *ScopeKey) FromScopesStr(modes, times []string)

FromScopesStr creates an associated scope merging the modes and times that are specified as strings If you modify this, also modify ModesAndTimes, below.

func (*ScopeKey) ModeAndTime

func (sk *ScopeKey) ModeAndTime() (mode EvalModes, time Times)

ModeAndTime returns the singular mode and time as enums from a concrete scope key having one of each (No* cases if not standard)

func (*ScopeKey) ModesAndTimes

func (sk *ScopeKey) ModesAndTimes() (modes, times []string)

ModesAndTimes returns the mode(s) and time(s) as strings from the current key value. This must be the inverse of FromScopesStr

func (*ScopeKey) ModesAndTimesMap

func (sk *ScopeKey) ModesAndTimesMap() (modes, times map[string]bool)

ModesAndTimesMap returns maps of modes and times as strings parsed from the current scopekey

type Times

type Times int32

Times the enum

const (
	// NoTime represents a non-initialized value
	NoTime Times = iota

	// AllTimes indicates that the log should occur over all times present in other items.
	AllTimes

	// Cycle is the finest time scale -- typically 1 msec -- a single activation update.
	Cycle

	// FastSpike is typically 10 cycles = 10 msec (100hz) = the fastest spiking time
	// generally observed in the brain.  This can be useful for visualizing updates
	// at a granularity in between Cycle and GammaCycle.
	FastSpike

	// GammaCycle is typically 25 cycles = 25 msec (40hz)
	GammaCycle

	// Phase is either Minus or Plus phase, where plus phase is bursting / outcome
	// that drives positive learning relative to prediction in minus phase.
	Phase

	// BetaCycle is typically 50 cycles = 50 msec (20 hz) = one beta-frequency cycle.
	// Gating in the basal ganglia and associated updating in prefrontal cortex
	// occurs at this frequency.
	BetaCycle

	// AlphaCycle is typically 100 cycles = 100 msec (10 hz) = one alpha-frequency cycle.
	AlphaCycle

	// ThetaCycle is typically 200 cycles = 200 msec (5 hz) = two alpha-frequency cycles.
	// This is the modal duration of a saccade, the update frequency of medial temporal lobe
	// episodic memory, and the minimal predictive learning cycle (perceive an Alpha 1, predict on 2).
	ThetaCycle

	// Event is the smallest unit of naturalistic experience that coheres unto itself
	// (e.g., something that could be described in a sentence).
	// Typically this is on the time scale of a few seconds: e.g., reaching for
	// something, catching a ball.
	Event

	// Trial is one unit of behavior in an experiment -- it is typically environmentally
	// defined instead of endogenously defined in terms of basic brain rhythms.
	// In the minimal case it could be one ThetaCycle, but could be multiple, and
	// could encompass multiple Events (e.g., one event is fixation, next is stimulus,
	// last is response)
	Trial

	// Tick is one step in a sequence -- often it is useful to have Trial count
	// up throughout the entire Epoch but also include a Tick to count trials
	// within a Sequence
	Tick

	// Sequence is a sequential group of Trials (not always needed).
	Sequence

	// Condition is a collection of Blocks that share the same set of parameters.
	// This is intermediate between Block and Run levels.
	Condition

	// Block is a collection of Trials, Sequences or Events, often used in experiments
	// when conditions are varied across blocks.
	Block

	// Epoch is used in two different contexts.  In machine learning, it represents a
	// collection of Trials, Sequences or Events that constitute a "representative sample"
	// of the environment.  In the simplest case, it is the entire collection of Trials
	// used for training.  In electrophysiology, it is a timing window used for organizing
	// the analysis of electrode data.
	Epoch

	// Run is a complete run of a model / subject, from training to testing, etc.
	// Often multiple runs are done in an Expt to obtain statistics over initial
	// random weights etc.
	Run

	// Expt is an entire experiment -- multiple Runs through a given protocol / set of
	// parameters.
	Expt

	// Scene is a sequence of events that constitutes the next larger-scale coherent unit
	// of naturalistic experience corresponding e.g., to a scene in a movie.
	// Typically consists of events that all take place in one location over
	// e.g., a minute or so. This could be a paragraph or a page or so in a book.
	Scene

	// Episode is a sequence of scenes that constitutes the next larger-scale unit
	// of naturalistic experience e.g., going to the grocery store or eating at a
	// restaurant, attending a wedding or other "event".
	// This could be a chapter in a book.
	Episode

	TimesN
)

A list of predefined time scales at which logging can occur

func (*Times) FromString

func (i *Times) FromString(s string) error

func (Times) MarshalJSON

func (ev Times) MarshalJSON() ([]byte, error)

func (Times) String

func (i Times) String() string

func (*Times) UnmarshalJSON

func (ev *Times) UnmarshalJSON(b []byte) error

type WriteFunc

type WriteFunc func(ctxt *Context)

WriteFunc function that computes and sets log values The Context provides information typically needed for logging

type WriteMap

type WriteMap map[ScopeKey]WriteFunc

WriteMap holds log writing functions for scope keys

Jump to

Keyboard shortcuts

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