public WeightDefinitionBag(bool rowMajor, params NeuroWeight <T>[] weights)
        {
            _disposed = false;

            var matrices = new Matrix <T> [weights.Length * 5];
            int cnt      = -1;

            for (int i = 0; i < weights.Length; i++)
            {
                var weigth = weights[i];
                matrices[++cnt] = weigth.Weight;
                matrices[++cnt] = weigth.Gradient;
                matrices[++cnt] = weigth.Cache1;
                matrices[++cnt] = weigth.Cache2;
                matrices[++cnt] = weigth.CacheM;
            }

            _ptrs = new MatrixPointersBag <T>(rowMajor, false, matrices);

            _defs = new WeightDefinition[weights.Length];
            cnt   = -1;
            for (int i = 0; i < weights.Length; i++)
            {
                var weight = weights[i];
                _defs[i] = new WeightDefinition(weight.Weight.RowCount, weight.Weight.ColumnCount, 1,
                                                _ptrs[++cnt], _ptrs[++cnt], _ptrs[++cnt], _ptrs[++cnt], _ptrs[++cnt]); // Oh yeah.
            }
        }
Beispiel #2
0
 public override void TestWeightTransferRowMajor(WeightDefinition weight)
 {
     Testing.TestWeightTransferRowMajorCpu(weight);
 }
Beispiel #3
0
 public static extern void TestComplexWeightTransferRowMajor(WeightDefinition weight);
Beispiel #4
0
 public abstract void TestWeightTransferRowMajor(WeightDefinition weight);
Beispiel #5
0
 public static extern void TestWeightTransferRowMajorGpu(WeightDefinition weight);