Example #1
0
 public static uint GetStructSize()
 {
     if (m_structSize == 0)
     {
         MyLayerDim dummy = new MyLayerDim();
         m_structSize = (uint)Marshal.SizeOf(dummy);
     }
     return(m_structSize);
 }
        public override void AllocateMemory()
        {
            base.AllocateMemory();

            m_delta = m_output;

            m_deltaBlock = m_network.DeltasMemoryBlock;
            m_deltaOffset = m_network.DeltasMemoryBlock.Count;
            m_deltaDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_network.DeltasMemoryBlock.Count += m_delta.Count;
        }
        public override void AllocateMemory()
        {
            base.AllocateMemory();

            m_delta = m_output;

            m_deltaBlock           = m_network.DeltasMemoryBlock;
            m_deltaOffset          = m_network.DeltasMemoryBlock.Count;
            m_deltaDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_network.DeltasMemoryBlock.Count += m_delta.Count;
        }
        public override void AllocateMemory()
        {
            base.AllocateMemory();

            m_weightChange = m_weight;
            m_biasChange   = m_bias;

            m_weightBlock  = m_network.WeightsMemoryBlock;
            m_weightOffset = m_network.WeightsMemoryBlock.Count;
            m_network.WeightsMemoryBlock.Count += m_weight.Count;
            m_weightDimGPUPtrOffset             = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_weightChangeBlock  = m_network.WeightChangesMemoryBlock;
            m_weightChangeOffset = m_network.WeightChangesMemoryBlock.Count;
            m_network.WeightChangesMemoryBlock.Count += m_weightChange.Count;
            m_weightChangeDimGPUPtrOffset             = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_biasBlock  = m_network.WeightsMemoryBlock;
            m_biasOffset = m_network.WeightsMemoryBlock.Count;
            m_network.WeightsMemoryBlock.Count += m_bias.Count;
            m_biasDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_biasChangeBlock  = m_network.WeightChangesMemoryBlock;
            m_biasChangeOffset = m_network.WeightChangesMemoryBlock.Count;
            m_network.WeightChangesMemoryBlock.Count += m_biasChange.Count;
            m_biasChangeDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_lastWeightDeltaBlock  = m_network.WeightChangesMemoryBlock;
            m_lastWeightDeltaOffset = m_network.WeightChangesMemoryBlock.Count;
            m_network.WeightChangesMemoryBlock.Count += m_lastWeightDelta.Count;
            m_lastWeightDeltaDimGPUPtrOffset          = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_storedOutputBlock  = m_network.WeightChangesMemoryBlock;
            m_storedOutputOffset = m_network.WeightChangesMemoryBlock.Count;
            m_network.WeightChangesMemoryBlock.Count += m_storedOutput.Count;
            m_storedOutputDimGPUPtrOffset             = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;
        }
        public override void AllocateMemory()
        {
            base.AllocateMemory();

            m_weightChange = m_weight;
            m_biasChange = m_bias;

            m_weightBlock = m_network.WeightsMemoryBlock;
            m_weightOffset = m_network.WeightsMemoryBlock.Count;
            m_network.WeightsMemoryBlock.Count += m_weight.Count;
            m_weightDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_weightChangeBlock = m_network.WeightChangesMemoryBlock;
            m_weightChangeOffset = m_network.WeightChangesMemoryBlock.Count;
            m_network.WeightChangesMemoryBlock.Count += m_weightChange.Count;
            m_weightChangeDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_biasBlock = m_network.WeightsMemoryBlock;
            m_biasOffset = m_network.WeightsMemoryBlock.Count;
            m_network.WeightsMemoryBlock.Count += m_bias.Count;
            m_biasDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_biasChangeBlock = m_network.WeightChangesMemoryBlock;
            m_biasChangeOffset = m_network.WeightChangesMemoryBlock.Count;
            m_network.WeightChangesMemoryBlock.Count += m_biasChange.Count;
            m_biasChangeDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_lastWeightDeltaBlock = m_network.WeightChangesMemoryBlock;
            m_lastWeightDeltaOffset = m_network.WeightChangesMemoryBlock.Count;
            m_network.WeightChangesMemoryBlock.Count += m_lastWeightDelta.Count;
            m_lastWeightDeltaDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;

            m_storedOutputBlock = m_network.WeightChangesMemoryBlock;
            m_storedOutputOffset = m_network.WeightChangesMemoryBlock.Count;
            m_network.WeightChangesMemoryBlock.Count += m_storedOutput.Count;
            m_storedOutputDimGPUPtrOffset = m_network.DataDimsMemoryBlock.Count;
            m_network.DataDimsMemoryBlock.Count++;
        }
Example #6
0
 public static uint GetStructSize()
 {
     if (m_structSize == 0)
     {
         MyLayerDim dummy = new MyLayerDim();
         m_structSize = (uint)Marshal.SizeOf(dummy);
     }
     return m_structSize;
 }