Sigma
Public Member Functions | Properties | List of all members
Sigma.Core.Training.Hooks.IHook Interface Reference

Represents a hook which can be used to "hook" into operations and execute custom code at a certain time step. The required parameters from the callers registry must be denoted before Invoke is first called (so that the operator can fetch the requested parameters). More...

Inheritance diagram for Sigma.Core.Training.Hooks.IHook:
Sigma.Core.Training.Hooks.BaseHook Sigma.Core.Training.Hooks.ICommand Sigma.Core.Training.Hooks.Accumulators.NumberAccumulatorHook Sigma.Core.Training.Hooks.BaseCommand Sigma.Core.Training.Hooks.LambdaHook Sigma.Core.Training.Hooks.Reporters.CurrentEpochIterationReporter Sigma.Core.Training.Hooks.Reporters.ValidationAccuracyReporter Sigma.Core.Training.Hooks.Reporters.ValueReporterHook Sigma.Core.Training.Hooks.Scorers.BaseValidationScorer Sigma.Core.Training.Hooks.BaseCommand

Public Member Functions

void Invoke (IRegistry registry, IRegistryResolver resolver)
 Invoke this hook with a certain parameter registry (and the corresponding resolver). More...
 
bool FunctionallyEquals (IHook other)
 Check if this hook's functionality is equal to that of another. Used when deciding which hooks can be omitted (optimised out). Note: Different parameters typically infer different functionalities. If your custom hook requires any external parameters that alter its behaviour reflect that in this method. More...
 

Properties

ITimeStep TimeStep [get]
 The time step at which to execute this hook. More...
 
IReadOnlyCollection< string > RequiredRegistryEntries [get]
 The global registry entries required for the execution of this hook. More...
 
IReadOnlyCollection< IHookRequiredHooks [get]
 The hooks that are required for this hook (i.e. the hooks this hook depends on). Required hooks are automatically instantiated when Required hooks are prioritised and executed before the dependent hook. Note: If multiple required hooks are functionally equivalent, only one will be invoked. The time step of required hooks must be smaller than or equal to the dependent's time step. More...
 
int InvokePriority [get]
 The invoke priority of this hook (i.e. invoke as first or last hook). An invoke priority of 0 is the default, smaller than 0 means invoke earlier, larger than 0 means invoke later. Note: The RequiredHooks take precedence over invoke priority. Invoke priorities are only a recommendation and cannot be guaranteed. More...
 
bool InvokeInBackground [get]
 Flag whether this hook should be invoked by the owner (worker/operator) or in a separate background thread. Note: When invoked in background, hooks received a complete copy of all required registry entries and can therefore not directly modify the parameters of a worker/operator. More...
 
IOperator Operator [get, set]
 The operator that owns this hook. More...
 
TargetMode DefaultTargetMode [get]
 The preferred target mode of this hook (i.e. where to invoke it if not explicitly specified). More...
 

Detailed Description

Represents a hook which can be used to "hook" into operations and execute custom code at a certain time step. The required parameters from the callers registry must be denoted before Invoke is first called (so that the operator can fetch the requested parameters).

Member Function Documentation

◆ FunctionallyEquals()

bool Sigma.Core.Training.Hooks.IHook.FunctionallyEquals ( IHook  other)

Check if this hook's functionality is equal to that of another. Used when deciding which hooks can be omitted (optimised out). Note: Different parameters typically infer different functionalities. If your custom hook requires any external parameters that alter its behaviour reflect that in this method.

Parameters
otherThe hook to check.
Returns
A boolean indicating whether or not the other hook does the same that this one does.

Implemented in Sigma.Core.Training.Hooks.BaseHook.

◆ Invoke()

void Sigma.Core.Training.Hooks.IHook.Invoke ( IRegistry  registry,
IRegistryResolver  resolver 
)

Invoke this hook with a certain parameter registry (and the corresponding resolver).

Parameters
registryThe registry containing the required values for this hook's execution.
resolverThe to the registry corresponding registry resolver for easier access to nested / tagged / filtered elements.

Implemented in Sigma.Core.Training.Hooks.BaseHook, Sigma.Core.Training.Hooks.Reporters.ValueReporterHook, Sigma.Core.Training.Hooks.Reporters.ValidationAccuracyReporter, Sigma.Core.Training.Hooks.Scorers.BaseValidationScorer, Sigma.Core.Training.Hooks.LambdaHook, Sigma.Core.Training.Hooks.Reporters.CurrentEpochIterationReporter, and Sigma.Core.Training.Hooks.Accumulators.NumberAccumulatorHook.

Property Documentation

◆ DefaultTargetMode

TargetMode Sigma.Core.Training.Hooks.IHook.DefaultTargetMode
get

The preferred target mode of this hook (i.e. where to invoke it if not explicitly specified).

◆ InvokeInBackground

bool Sigma.Core.Training.Hooks.IHook.InvokeInBackground
get

Flag whether this hook should be invoked by the owner (worker/operator) or in a separate background thread. Note: When invoked in background, hooks received a complete copy of all required registry entries and can therefore not directly modify the parameters of a worker/operator.

◆ InvokePriority

int Sigma.Core.Training.Hooks.IHook.InvokePriority
get

The invoke priority of this hook (i.e. invoke as first or last hook). An invoke priority of 0 is the default, smaller than 0 means invoke earlier, larger than 0 means invoke later. Note: The RequiredHooks take precedence over invoke priority. Invoke priorities are only a recommendation and cannot be guaranteed.

◆ Operator

IOperator Sigma.Core.Training.Hooks.IHook.Operator
getset

The operator that owns this hook.

◆ RequiredHooks

IReadOnlyCollection<IHook> Sigma.Core.Training.Hooks.IHook.RequiredHooks
get

The hooks that are required for this hook (i.e. the hooks this hook depends on). Required hooks are automatically instantiated when Required hooks are prioritised and executed before the dependent hook. Note: If multiple required hooks are functionally equivalent, only one will be invoked. The time step of required hooks must be smaller than or equal to the dependent's time step.

◆ RequiredRegistryEntries

IReadOnlyCollection<string> Sigma.Core.Training.Hooks.IHook.RequiredRegistryEntries
get

The global registry entries required for the execution of this hook.

◆ TimeStep

ITimeStep Sigma.Core.Training.Hooks.IHook.TimeStep
get

The time step at which to execute this hook.


The documentation for this interface was generated from the following file: