Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
daelsepara committed May 14, 2019
1 parent 07a59b7 commit 3ddbed1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
15 changes: 6 additions & 9 deletions DeepNeuralNetworkClassifier/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,18 +378,15 @@ protected void SaveJson(ref string FileName, string title, Entry entry, string d

var ext = JsonSaver.Filter.Name;

FileName = String.Format("{0}.{1}", GetBaseFileName(FileName), ext);

if (!string.IsNullOrEmpty(data))
{
var fullpath = String.Format("{0}/{1}", directory, FileName);

try
{
using (var file = new StreamWriter(fullpath, false))
{
file.Write(data);
}
Utility.Save(directory, GetBaseFileName(FileName), data);

FileName = String.Format("{0}.{1}", GetBaseFileName(FileName), ext);

var fullpath = String.Format("{0}/{1}", directory, FileName);

FileName = fullpath;

Expand Down Expand Up @@ -1345,7 +1342,7 @@ protected void OnSaveNetworkButtonClicked(object sender, EventArgs e)
protected void OnUseL2Toggled(object sender, EventArgs e)
{
Options.UseL2 = UseL2.Active;

if (UseL2.Active)
{
UseOptimizer.Active = false;
Expand Down
9 changes: 2 additions & 7 deletions DeepNeuralNetworkClassifier/ModelJSON.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static void Save(string BaseDirectory, string Filename, string json)
}
}

static string ReadString(string BaseDirectory, string Filename)
static string LoadJSON(string BaseDirectory, string Filename)
{
var json = "";

Expand All @@ -126,7 +126,7 @@ static string ReadString(string BaseDirectory, string Filename)

public static ManagedDNN LoadDNN(string BaseDirectory, string Filename, ManagedArray normalization)
{
var json = ReadString(BaseDirectory, Filename);
var json = LoadJSON(BaseDirectory, Filename);

var network = !string.IsNullOrEmpty(json) ? DeserializeDNN(json) : null;

Expand All @@ -150,10 +150,5 @@ public static ManagedDNN LoadDNN(string BaseDirectory, string Filename, ManagedA

return network;
}

public static string LoadJson(string BaseDirectory, string FileName)
{
return ReadString(BaseDirectory, FileName);
}
}
}

0 comments on commit 3ddbed1

Please # to comment.