Skip to content

Commit b3e0a6a

Browse files
committed
Update tiled net.
1 parent 5d91b21 commit b3e0a6a

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

examples/gravnet/ParallelReverseAutoDiff.GravNetExample/TiledNet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void AdjustLearningRate(double learningRate)
8181
/// <returns>The task.</returns>
8282
public async Task Initialize()
8383
{
84-
var initialAdamIteration = 1726;
84+
var initialAdamIteration = 33;
8585
var model = new TiledNetwork.TiledNetwork(this.numLayers, this.numNodes, this.numFeatures, this.learningRate, this.clipValue, "tilednet");
8686
model.Parameters.AdamIteration = initialAdamIteration;
8787
this.TiledNetwork = model;
@@ -122,7 +122,7 @@ public void SaveWeights()
122122
/// </summary>
123123
public void ApplyWeights()
124124
{
125-
var guid = "tiled_717e1887-0217-447c-bc39-33c64d2c5994_1726";
125+
var guid = "tiled_adf4a823-dbde-49c6-9505-c751f8097ffc_33";
126126
var dir = $"E:\\vnnstore\\{guid}";
127127
for (int i = 0; i < this.modelLayers.Count; ++i)
128128
{

examples/gravnet/ParallelReverseAutoDiff.GravNetExample/TiledNetTrainer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public async Task Train()
1414
CudaBlas.Instance.Initialize();
1515
TiledNet net = new TiledNet(512, 6144, 3, 0.01d, 4d);
1616
await net.Initialize();
17-
net.ApplyWeights();
17+
//net.ApplyWeights();
1818

1919
var pngFiles = Directory.GetFiles(@"E:\images\inputs\svg", "*.png");
2020

@@ -112,7 +112,7 @@ await files.WithRepeatAsync(async (pngFile, token) =>
112112
Console.WriteLine($"Loss: {lossAndGradient[2, 0].Item1[0, 0]}, {lossAndGradient[2, 1].Item1[0, 0]}, {lossAndGradient[2, 2].Item1[0, 0]}");
113113
//Console.WriteLine($"O1 X: {o1[0, 0]}, O1 Y: {o1[0, 1]}, Loss: {loss[0, 0]}, {loss0[0, 0]}, {loss1[0, 0]}");
114114
await net.Backward(lossAndGradient);
115-
//net.ApplyGradients();
115+
net.ApplyGradients();
116116
//}
117117

118118
await net.Reset();

examples/gravnet/ParallelReverseAutoDiff.GravNetExample/TiledNetwork/TiledNetwork.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,14 @@ public async Task<Matrix> AutomaticBackwardPropagate((Matrix, Matrix)[,] lossAnd
361361
{
362362
for (int j = 0; j < lossAndGradient.GetLength(1); j++)
363363
{
364-
if ((i == 0 && j == 0) || (i == 0 && j == 1))
365-
{
364+
//if ((i == 0 && j == 0) || (i == 0 && j == 1))
365+
//{
366366
grad[i, j] = lossAndGradient[i, j].Item2;
367-
}
368-
else
369-
{
370-
grad[i, j] = new Matrix(1, 2);
371-
}
367+
//}
368+
//else
369+
//{
370+
// grad[i, j] = new Matrix(1, 2);
371+
//}
372372
}
373373
}
374374

0 commit comments

Comments
 (0)