Exemple #1
0
        public void ComputesCompatibleTensorDimsWithInvalidData()
        {
            var dims = TensorDimensions.GetBackwardCompatibleDims(0, 0);

            Assert.Equal(1, dims.Rank);
            Assert.Equal(0, dims[0]);
        }
Exemple #2
0
        public void ComputesCompatibleTensorDims()
        {
            var dims = TensorDimensions.GetBackwardCompatibleDims(10, 2);

            Assert.Equal(2, dims[0]);
            Assert.Equal(5, dims[1]);
        }
Exemple #3
0
        public void ComputesCompatibleTensorDimsWithWrongColumnHint()
        {
            var dims = TensorDimensions.GetBackwardCompatibleDims(10, 3);

            Assert.Equal(1, dims.Rank);
            Assert.Equal(10, dims[0]);
        }
Exemple #4
0
 public override void UpdateMemoryBlocks()
 {
     Output.Count = OutputSize;
     //Output.ColumnHint = ColumnHint;
     Output.Dims      = TensorDimensions.GetBackwardCompatibleDims(Output.Count, ColumnHint);
     RandomPool.Count = PatternCount * OutputSize;
     //RandomPool.ColumnHint = ColumnHint;
     RandomPool.Dims = TensorDimensions.GetBackwardCompatibleDims(RandomPool.Count, ColumnHint);
     Label.Count     = PatternCount / PatternGroups;
     //Label.ColumnHint = Label.Count;
     Label.Dims = TensorDimensions.GetBackwardCompatibleDims(Label.Count, Label.Count);
 }
 public override void UpdateMemoryBlocks()
 {
     if (ConvertToBinary)
     {
         if (m_userInput == null || m_userInput.Length != 1)
         {
             m_userInput = new float[1];
         }
     }
     else
     {
         if (m_userInput == null || m_userInput.Length != OutputSize)
         {
             m_userInput = new float[OutputSize];
         }
     }
     //Output.ColumnHint = ColumnHint;
     Output.Dims = TensorDimensions.GetBackwardCompatibleDims(Output.Count, ColumnHint);
 }