public static PropagationContext CreatePropagationContext(RNNSpec spec) { var pc = new PropagationContext(QMCreatePropagationContext(Structify(spec.Layers), spec.Layers.Count, spec.NumInputs, spec.Weights.ToArray(), spec.Weights.Count)); pc.OriginalSpec = spec; return(pc); }
public RNN(RNNSpec spec) { Spec = spec; Debug.Assert(!spec.Weights.Any(x => double.IsNaN(x))); PropagationContext = RNNInterop.CreatePropagationContext(spec); }
public static MRnnSpec FromRnnSpec(RNNSpec s) { return(new MRnnSpec(s.NumInputs, s.Layers.Select(sl => new MLayerSpec(sl.NodeCount, sl.IsRecurrent, sl.ActivationType)), s.Weights)); }