protected override void ConvertVariable(ComputeVariable _variable) { var variable = _variable as Variable.AffineVariable; BatchCount = variable.BatchCount; InWidth = variable.InWidth; InHeight = variable.InHeight; InputChannels = variable.InputChannels; OutWidth = variable.OutWidth; OutHeight = variable.OutHeight; OutputChannels = variable.OutputChannels; InSize = variable.InSize; InArea = variable.InArea; InTotal = variable.InTotal; OutSize = variable.OutSize; OutArea = variable.OutArea; OutTotal = variable.OutTotal; OptimizerType = variable.OptimizerType; Rho = variable.Rho; Weight = variable.Weight.Data; Input = variable.Input.Data; Output = variable.Output.Data; Sigma = variable.Sigma.Data; Propagator = variable.Propagator.Data; Error = variable.Error; Difference = variable.WeightDifference; }
public void AddConvolution(int outch, int kernelsize, int expand, Utility.Types.Optimizer type = Utility.Types.Optimizer.Adam, double scale = 1, double rho = 0.0005) { int inw, inh, inch; GetLayerInputInfomation(out inw, out inh, out inch); AddLayer(new Layer.Convolution(true) { Variable = new DedicatedFunction.Variable.ConvolutionVariable() { BatchCount = BatchCount, InputChannels = inch, InWidth = inw, InHeight = inh, OutputChannels = outch, OutScale = scale, KernelSize = kernelsize, KernelExpand = expand, OptimizerType = type, Rho = rho, }.Confirm(Instance), }.Confirm()); }
public static OptimizerBase CreateInstance(Utility.Types.Optimizer type, List <Components.RNdMatrix> sender, Components.Real[] weight) { OptimizerBase instance = null; switch (type) { case Utility.Types.Optimizer.Adam: instance = new Adam(sender, weight); break; case Utility.Types.Optimizer.AdaSelf: instance = new AdaSelf(sender, weight); break; default: break; } return(instance); }
protected override void ConvertVariable(ComputeVariable _variable) { var variable = _variable as Variable.ConvolutionVariable; BatchCount = variable.BatchCount; InWidth = variable.InWidth; InHeight = variable.InHeight; InputChannels = variable.InputChannels; OutScale = (float)variable.OutScale; OutWidth = variable.OutWidth; OutHeight = variable.OutHeight; OutputChannels = variable.OutputChannels; InSize = variable.InSize; InArea = variable.InArea; InTotal = variable.InTotal; OutSize = variable.OutSize; OutArea = variable.OutArea; OutTotal = variable.OutTotal; KernelSize = variable.KernelSize; KernelArea = variable.KernelArea; KernelLength = variable.KernelLength; KernelExpand = variable.KernelExpand; OptimizerType = variable.OptimizerType; rho = variable.Rho; Input = variable.Input.Data; Output = variable.Output.Data; Sigma = variable.Sigma.Data; Propagator = variable.Propagator.Data; WeightKernel = variable.WeightKernel.Data; WeightBias = variable.WeightBias.Data; Error = variable.Error; Difference = variable.WeightDifference; }
public void AddAffine(int outcount, Utility.Types.Optimizer type = Utility.Types.Optimizer.Adam, double rho = 0.0005) { int inw, inh, inch; GetLayerInputInfomation(out inw, out inh, out inch); AddLayer(new Layer.Affine(true) { Variable = new DedicatedFunction.Variable.AffineVariable() { BatchCount = BatchCount, InputChannels = inch, InWidth = inw, InHeight = inh, OutputChannels = 1, OutWidth = 1, OutHeight = outcount, OptimizerType = type, Rho = rho, }.Confirm(Instance), }.Confirm()); }