forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.Compile.cs
More file actions
48 lines (39 loc) · 1.38 KB
/
Model.Compile.cs
File metadata and controls
48 lines (39 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using Tensorflow.Keras.ArgsDefinition;
using Tensorflow.Keras.Losses;
using Tensorflow.Keras.Optimizers;
namespace Tensorflow.Keras.Engine
{
public partial class Model
{
LossesContainer compiled_loss;
MetricsContainer compiled_metrics;
public void compile(ILossFunc loss, OptimizerV2 optimizer, string[] metrics)
{
this.optimizer = optimizer;
compiled_loss = new LossesContainer(loss, output_names: output_names);
compiled_metrics = new MetricsContainer(metrics, output_names: output_names);
int experimental_steps_per_execution = 1;
_configure_steps_per_execution(experimental_steps_per_execution);
// Initialize cache attrs.
_reset_compile_cache();
_is_compiled = true;
this.loss = loss;
}
public void compile(string optimizer, string loss, string[] metrics)
{
switch (optimizer)
{
case "rmsprop":
this.optimizer = new RMSprop(new RMSpropArgs
{
});
break;
}
int experimental_steps_per_execution = 1;
_configure_steps_per_execution(experimental_steps_per_execution);
_reset_compile_cache();
_is_compiled = true;
}
}
}