public void InitializeService(NetworkInitializer initializer) { LVQInitializer input = (LVQInitializer)initializer; int VEC_LEN = input.patterns[0].Length; int TRAINING_PATTERNS = input.patterns.GetUpperBound(0) + 1; inputs = new double[TRAINING_PATTERNS][]; for (int i = 0; i < TRAINING_PATTERNS; i++) { inputs[i] = new double[VEC_LEN]; } for (int i = 0; i < TRAINING_PATTERNS; i++) { for (int j = 0; j < VEC_LEN; j++) { inputs[i][j] = input.patterns[i][j]; } } this.clusters = new int[TRAINING_PATTERNS]; int[] formedAnswers = Normalize.FormAnswersLVQ(input.answers); for (int i = 0; i < TRAINING_PATTERNS; i++) { this.clusters[i] = formedAnswers[i]; } this.minError = input.minError; this.learningRate = input.learningRate; this.decayRate = input.decayRate; this.numOfClusters = input.numOfClusters; }
public virtual void InitializeService(NetworkInitializer initializer) { BPNInitializer input = (BPNInitializer)initializer; this.parameters = input.parameters; this.hidden = input.hidden; this.learningRate = input.learningRate; this.Momentum = input.Momentum; this.minError = input.minError; layerSizes = new int[3] { this.parameters, this.hidden, 1 }; TFuncs = new TransferFunction[3] { TransferFunction.None, TransferFunction.BipolarSigmoid, TransferFunction.BipolarSigmoid }; }