public override void Compile(AbstractCostFunction lossFunction, AbstractOptimizer optimizer) { AbstractLayer previousLayer = null; // compile each layer and check dimension // of input and output //layers.Reverse(); foreach (AbstractLayer layer in layers) { previousLayer = layer.Compile(previousLayer); } this.lossFunction = lossFunction; this.optimizer = optimizer; }
/// <summary> /// Compile model through all layers and check /// dimensions of networks /// </summary> /// <param name="costFunction">Type of cost function which will /// be used for training.</param> /// <param name="optimizer">Type of optimizer which will be used /// for training.</param> public abstract void Compile(AbstractCostFunction costFunction, AbstractOptimizer optimizer);