forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.Metrics.cs
More file actions
35 lines (30 loc) · 883 Bytes
/
Model.Metrics.cs
File metadata and controls
35 lines (30 loc) · 883 Bytes
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
using System.Collections.Generic;
using Tensorflow.Keras.Metrics;
namespace Tensorflow.Keras.Engine
{
public partial class Model
{
public IEnumerable<Metric> metrics
{
get
{
var _metrics = new List<Metric>();
if (_is_compiled)
{
if (compiled_loss != null)
_metrics.add(compiled_loss.metrics);
if (compiled_metrics != null)
_metrics.add(compiled_metrics.metrics);
}
/*foreach (var layer in _flatten_layers())
_metrics.extend(layer.metrics);*/
return _metrics;
}
}
void reset_metrics()
{
foreach (var metric in metrics)
metric.reset_states();
}
}
}