Esempio n. 1
0
            static public RNNCell RNNCell(long inputSize, long hiddenSize, NonLinearities nonLinearity = nn.NonLinearities.Tanh, bool bias = true)
            {
                var res = THSNN_RNNCell_ctor(inputSize, hiddenSize, (long)nonLinearity, bias, out var boxedHandle);

                if (res == IntPtr.Zero)
                {
                    torch.CheckForErrors();
                }
                return(new RNNCell(res, boxedHandle));
            }
Esempio n. 2
0
            static public RNN RNN(long inputSize, long hiddenSize, long numLayers = 1, NonLinearities nonLinearity = nn.NonLinearities.Tanh, bool bias = true, bool batchFirst = false, double dropout = 0.0, bool bidirectional = false)
            {
                var res = THSNN_RNN_ctor(inputSize, hiddenSize, numLayers, (long)nonLinearity, bias, batchFirst, dropout, bidirectional, out var boxedHandle);

                if (res == IntPtr.Zero)
                {
                    torch.CheckForErrors();
                }
                return(new RNN(res, boxedHandle));
            }