コード例 #1
0
ファイル: RNN.cs プロジェクト: deTrident/RNNSharp
        public static RNN <T> CreateRNN(NETWORKTYPE networkType)
        {
            RNN <T> rnn = null;

            switch (networkType)
            {
            case NETWORKTYPE.Forward:
                rnn = new ForwardRNN <T>();
                break;

            case NETWORKTYPE.ForwardSeq2Seq:
                rnn = new ForwardRNNSeq2Seq <T>();
                break;

            case NETWORKTYPE.ForwardSeq2SeqLabeling:
                rnn = new ForwardRNNSeq2SeqLabeling <T>();
                break;

            case NETWORKTYPE.BiDirectional:
                rnn = new BiRNN <T>();
                break;

            case NETWORKTYPE.BiDirectionalAverage:
                rnn = new BiRNNAvg <T>();
                break;
            }
            return(rnn);
        }
コード例 #2
0
        public override RNN <T> Clone()
        {
            List <SimpleLayer> hiddenLayers = new List <SimpleLayer>();

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

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

            rnn.HiddenLayerList    = hiddenLayers;
            rnn.OutputLayer        = OutputLayer.CreateLayerSharedWegiths();
            rnn.CRFTagTransWeights = CRFTagTransWeights;
            rnn.MaxSeqLength       = MaxSeqLength;
            rnn.crfLocker          = crfLocker;

            return(rnn);
        }
コード例 #3
0
        public override RNN <T> Clone()
        {
            List <SimpleLayer> hiddenLayers = new List <SimpleLayer>();

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

            ForwardRNN <T> rnn = new ForwardRNN <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);
        }