Exemple #1
0
        public void Reset(IWeightFactory weightFactory, int batchSize)
        {
            if (m_hidden != null)
            {
                m_hidden.Dispose();
                m_hidden = null;
            }

            if (m_cell != null)
            {
                m_cell.Dispose();
                m_cell = null;
            }

            m_hidden = weightFactory.CreateWeightTensor(batchSize, m_hdim, m_deviceId, true, name: $"{m_name}.{nameof(m_hidden)}", isTrainable: true);
            m_cell   = weightFactory.CreateWeightTensor(batchSize, m_hdim, m_deviceId, true, name: $"{m_name}.{nameof(m_cell)}", isTrainable: true);
        }
Exemple #2
0
        public void Reset(IWeightFactory weightFactory, int batchSize)
        {
            if (this.m_hidden != null)
            {
                this.m_hidden.Dispose();
                this.m_hidden = null;
            }

            if (this.m_cell != null)
            {
                this.m_cell.Dispose();
                this.m_cell = null;
            }

            this.m_hidden = weightFactory.CreateWeightTensor(batchSize, this.m_hdim, this.m_deviceId, true, $"{this.m_name}.{nameof(this.m_hidden)}", true);
            this.m_cell   = weightFactory.CreateWeightTensor(batchSize, this.m_hdim, this.m_deviceId, true, $"{this.m_name}.{nameof(this.m_cell)}", true);
        }
Exemple #3
0
 public void Reset(IWeightFactory weightFactory, int batchSize)
 {
     Hidden = weightFactory.CreateWeightTensor(batchSize, m_hiddenDim, m_deviceId, true, name: $"{m_name}.{nameof(Hidden)}", isTrainable: true);
     Cell   = weightFactory.CreateWeightTensor(batchSize, m_hiddenDim, m_deviceId, true, name: $"{m_name}.{nameof(Cell)}", isTrainable: true);
 }
 public void Reset(IWeightFactory weightFactory, int batchSize)
 {
     this.Hidden = weightFactory.CreateWeightTensor(batchSize, this.m_hiddenDim, this.m_deviceId, true, $"{this.m_name}.{nameof(this.Hidden)}", true);
     this.Cell   = weightFactory.CreateWeightTensor(batchSize, this.m_hiddenDim, this.m_deviceId, true, $"{this.m_name}.{nameof(this.Cell)}", true);
 }