Skip to content

Commit 9396163

Browse files
committed
Update glyph net.
1 parent a476f73 commit 9396163

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

examples/gravnet/ParallelReverseAutoDiff.GravNetExample/GlyphNet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void AdjustLearningRate(double learningRate)
8080
/// <returns>The task.</returns>
8181
public async Task Initialize()
8282
{
83-
var initialAdamIteration = 138;
83+
var initialAdamIteration = 1;
8484
var model = new GlyphNetwork.GlyphNetwork(this.numLayers, this.numNodes, this.numFeatures, this.learningRate, this.clipValue, "glyphnet");
8585
model.Parameters.AdamIteration = initialAdamIteration;
8686
this.GlyphNetwork = model;

examples/gravnet/ParallelReverseAutoDiff.GravNetExample/GlyphNetTrainer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public async Task Train()
1414
CudaBlas.Instance.Initialize();
1515
GlyphNet net = new GlyphNet(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

@@ -107,7 +107,6 @@ await files.WithRepeatAsync(async (pngFile, token) =>
107107
net.SaveWeights();
108108
}
109109

110-
token.Repeat();
111110
//if (token.UsageCount == 0)
112111
//{
113112
// token.Repeat(2);

examples/gravnet/ParallelReverseAutoDiff.GravNetExample/GlyphNetwork/GlyphNetwork.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,6 @@ public async Task<Matrix> AutomaticBackwardPropagate(Matrix gradient, Matrix gra
379379
gg[i, 1] = outputResult[i, 1] + targetedResult0[i, 1] + targetedResult1[i, 1];
380380
}
381381

382-
for (int i = 0; i < 225; i++)
383-
{
384-
gg[i, 0] = targetedResult1[i, 0];
385-
gg[i, 1] = targetedResult1[i, 1];
386-
}
387-
388382
backwardStartOperation = glyph;
389383
}
390384
else

0 commit comments

Comments
 (0)