Example #1
0
        public override RNN <T> Clone()
        {
            List <SimpleLayer> hiddenLayers = new List <SimpleLayer>();

            List <float[]>[] denseFeatureGroupsList = new List <float[]> [HiddenLayerList.Count];

            int i = 0;

            foreach (SimpleLayer layer in HiddenLayerList)
            {
                hiddenLayers.Add(layer.CreateLayerSharedWegiths());
                denseFeatureGroupsList[i] = new List <float[]>();
                i++;
            }

            List <float[]> denseFeatureGroupsOutputLayer = new List <float[]>();

            ForwardRNNSeq2Seq <T> rnn = new ForwardRNNSeq2Seq <T>();

            rnn.HiddenLayerList               = hiddenLayers;
            rnn.OutputLayer                   = OutputLayer.CreateLayerSharedWegiths();
            rnn.CRFWeights                    = CRFWeights;
            rnn.denseFeatureGroupsList        = denseFeatureGroupsList;
            rnn.denseFeatureGroupsOutputLayer = denseFeatureGroupsOutputLayer;
            rnn.sparseFeatureGorups           = new List <SparseVector>();
            rnn.MaxSeqLength                  = MaxSeqLength;
            rnn.bVQ           = bVQ;
            rnn.IsCRFTraining = IsCRFTraining;
            if (rnn.IsCRFTraining)
            {
                rnn.InitializeCRFVariablesForTraining();
            }

            return(rnn);
        }
Example #2
0
        public override RNN <T> Clone()
        {
            List <SimpleLayer> hiddenLayers = new List <SimpleLayer>();

            foreach (SimpleLayer layer in HiddenLayerList)
            {
                hiddenLayers.Add(layer.CreateLayerSharedWegiths());
            }

            ForwardRNNSeq2Seq <T> rnn = new ForwardRNNSeq2Seq <T>();

            rnn.HiddenLayerList = hiddenLayers;
            rnn.OutputLayer     = OutputLayer.CreateLayerSharedWegiths();
            rnn.CRFWeights      = CRFWeights;
            rnn.MaxSeqLength    = MaxSeqLength;
            rnn.bVQ             = bVQ;
            rnn.IsCRFTraining   = IsCRFTraining;
            if (rnn.IsCRFTraining)
            {
                rnn.InitializeCRFVariablesForTraining();
            }

            return(rnn);
        }