A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/signumsoftware/framework/commit/4f28e79349892c7f5045172c9e2e1d4b374b6dac below:

add Upgrade_20201230_TensorFlow · signumsoftware/framework@4f28e79 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+88

-0

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+88

-0

lines changed Original file line number Diff line number Diff line change

@@ -40,6 +40,7 @@ static void Main(string[] args)

40 40

new Upgrade_20201210_NavigatorView(),

41 41

new Upgrade_20201220_React17(),

42 42

new Upgrade_20201223_IndexErrorHandling(),

43 +

new Upgrade_20201230_TensorFlow(),

43 44

}.Run(uctx);

44 45

}

45 46

}

Original file line number Diff line number Diff line change

@@ -0,0 +1,87 @@

1 +

using Signum.Utilities;

2 +

using System;

3 +

using System.Collections.Generic;

4 +

using System.IO;

5 +

using System.Linq;

6 +

using System.Security.Cryptography.X509Certificates;

7 +

using System.Text;

8 +

using System.Threading.Tasks;

9 + 10 +

namespace Signum.Upgrade.Upgrades

11 +

{

12 +

class Upgrade_20201230_TensorFlow : CodeUpgradeBase

13 +

{

14 +

public override string Description => "replace CNTK for TensorFlow";

15 + 16 +

public override void Execute(UpgradeContext uctx)

17 +

{

18 +

uctx.ChangeCodeFile(@".gitignore", file =>

19 +

{

20 +

file.InsertAfterLastLine(

21 +

a=>a.Contains("ts_out"),

22 +

@"/Southwind.React/TensorFlowModels/**");

23 +

});

24 + 25 +

uctx.ChangeCodeFile(@"Southwind.Logic/Southwind.Logic.csproj", file =>

26 +

{

27 +

file.Replace(

28 +

@"Signum.Engine.MachineLearning.CNTK\Signum.Engine.MachineLearning.CNTK.csproj",

29 +

@"Signum.Engine.MachineLearning.TensorFlow\Signum.Engine.MachineLearning.TensorFlow.csproj");

30 + 31 +

});

32 + 33 +

uctx.ChangeCodeFile(@"Southwind.React/Southwind.React.csproj", file =>

34 +

{

35 +

file.ReplaceLine(a => a.Contains("CNTK.CPUOnly"),

36 +

@"<PackageReference Include=""SciSharp.TensorFlow.Redist"" Version=""2.3.1"" />"

37 +

);

38 +

});

39 + 40 +

uctx.ChangeCodeFile(@"Southwind.Logic/Starter.cs", file =>

41 +

{

42 +

file.Replace(

43 +

@"using Signum.Engine.MachineLearning.CNTK;",

44 +

@"using Signum.Engine.MachineLearning.TensorFlow;");

45 + 46 +

file.Replace(

47 +

@"CNTKPredictorAlgorithm.NeuralNetwork, new CNTKNeuralNetworkPredictorAlgorithm()",

48 +

@"TensorFlowPredictorAlgorithm.NeuralNetworkGraph, new TensorFlowNeuralNetworkPredictor()");

49 + 50 +

});

51 + 52 +

uctx.ChangeCodeFile(@"Southwind.Terminal/SouthwindMigrations.cs", file =>

53 +

{

54 +

file.Replace(

55 +

@"CNTKPredictorAlgorithm.NeuralNetwork",

56 +

@"TensorFlowPredictorAlgorithm.NeuralNetworkGraph");

57 + 58 +

file.Replace(

59 +

@"Learner = NeuralNetworkLearner.MomentumSGD",

60 +

@"Optimizer = TensorFlowOptimizer.GradientDescentOptimizer");

61 + 62 +

file.Replace(

63 +

@"LossFunction = NeuralNetworkEvalFunction.SquaredError",

64 +

@"LossFunction = NeuralNetworkEvalFunction.MeanSquaredError");

65 + 66 +

file.ReplaceBetweenIncluded(

67 +

a => a.Contains("LearningRate = 0.1,"),

68 +

a => a.Contains("LearningUnitGain = false,"),

69 +

@"LearningRate = 0.0001,");

70 +

});

71 + 72 +

uctx.ChangeCodeFile(@"*.csproj", file =>

73 +

{

74 +

file.RemoveAllLines(a => a.Contains("<Platforms>"));

75 +

file.ReplaceBetweenIncluded(

76 +

a => a.Contains("<PropertyGroup Condition="),

77 +

a => a.Contains("</PropertyGroup>"),

78 +

"");

79 +

});

80 + 81 +

uctx.ChangeCodeFile(@"Southwind.sln", file =>

82 +

{

83 +

file.Replace("x64", "Any CPU");

84 +

});

85 +

}

86 +

}

87 +

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4