Class RecurrentState
Object that represent memory (recurrent state) between the executions of a given model.
Namespace: Barracuda
Syntax
public class RecurrentState : IDisposable
Constructors
RecurrentState(Model, Int32, Dictionary<String, Tensor>)
Constructs recurrent state for a specific model
model
is the associated model.
batchSize
has to match the batch dimension of the input tensor(s). Specifying -1 will use batch size of the memory tensors as declared in the model.
grabFromInputs
optional dictionary of named tensors that can be used as a memory. If name of the tensor matches the memory, tensor will be removed from the dictionary and used as memory.
Declaration
public RecurrentState(Model model, int batchSize = -1, Dictionary<string, Tensor> grabFromInputs = null)
Parameters
Type | Name | Description |
---|---|---|
Model | model | |
Int32 | batchSize | |
Dictionary<String, Tensor> | grabFromInputs |
Methods
AfterExecution(IWorker)
Internal callback called after execution of the model finished. This callback stores results of the current iteration in the memory.
Declaration
public void AfterExecution(IWorker worker)
Parameters
Type | Name | Description |
---|---|---|
IWorker | worker |
BeforeExecution(IWorker)
Internal callback called before the execution of the model. This callback prepares model for the next iteration according to the memory.
Declaration
public void BeforeExecution(IWorker worker)
Parameters
Type | Name | Description |
---|---|---|
IWorker | worker |
Dispose()
Declaration
public virtual void Dispose()
Finalize()
Declaration
protected void Finalize()
GetBatchSize()
Returns batch dimension used for the memories.
Declaration
public int GetBatchSize()
Returns
Type | Description |
---|---|
Int32 |