/// <summary> /// Records the network activity /// </summary> /// <param name="context">Graph context</param> /// <param name="output">The output signal</param> /// <param name="backpropagation">Backpropagation creator (optional)</param> protected void _AddHistory(IContext context, IMatrix output, Func <IBackpropagation> backpropagation) { context.AddForward( new TrainingAction(this, new MatrixGraphData(output), new[] { _primarySource, _secondarySource }), backpropagation); }
public override void ExecuteForward(IContext context) { var curr = context.BatchSequence; var batch = curr.MiniBatch; var reversed = batch.GetSequenceAtIndex(batch.SequenceCount - curr.SequenceIndex - 1).Input; context.AddForward(new TrainingAction(this, reversed[_inputIndex], context.Source), null); }
/// <summary> /// Records the network activity /// </summary> /// <param name="context">The graph context</param> /// <param name="data">The list of incoming signals</param> /// <param name="output">Output signal</param> /// <param name="backpropagation">Backpropagation creator (optional)</param> protected void _AddHistory(IContext context, IReadOnlyList <IncomingChannel> data, IMatrix output, Func <IBackpropagation> backpropagation) { var sources = data.Select(d => d.Source).ToList(); context.AddForward(new TrainingAction(this, new MatrixGraphData(output), sources), backpropagation); }
public void AddForward(IExecutionHistory action, Func <IBackpropagation> callback) { // TODO: wrap the backpropagation? _context.AddForward(new TrainingAction(_wrapper, action.Data, action.Source), callback); }
/// <summary> /// Records the node execution and queues the output nodes for execution /// </summary> /// <param name="context"></param> /// <param name="data"></param> /// <param name="backProp"></param> protected void _AddNextGraphAction(IContext context, IGraphData data, Func <IBackpropagation> backProp) { context.AddForward(new TrainingAction(this, data, context.Source), backProp); }