Skip to content

Commit

Permalink
Merge pull request #144 from cbovar/Fix_Fluent_Serialization
Browse files Browse the repository at this point in the history
Fix Fluent serialization
  • Loading branch information
cbovar authored Jul 26, 2019
2 parents 0060d03 + dbe8f31 commit 24588a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ConvNetSharp.Core.Tests/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ public void FluentNetSerialization()
var deserialized = SerializationExtensions.FromJson<double>(json);

Assert.AreEqual(9, deserialized.Layers.Count);
Assert.IsTrue(deserialized.Layers[0] is InputLayer<double>);
Assert.IsTrue(deserialized.Layers[8] is SoftmaxLayer<double>);
}

[TestMethod]
Expand Down
3 changes: 2 additions & 1 deletion src/ConvNetSharp.Core/Fluent/FluentNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ public Dictionary<string, object> GetData()
var dico = new Dictionary<string, object>();
var layers = new List<Dictionary<string, object>>();

foreach (var layer in this._allLayers)
for (var index = this._allLayers.Count - 1; index >= 0; index--)
{
var layer = this._allLayers[index];
layers.Add(layer.GetData());
}

Expand Down

0 comments on commit 24588a5

Please sign in to comment.