-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNNMetric.h
68 lines (57 loc) · 1.76 KB
/
NNMetric.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// Created by yuanyu on 2020.02.19.
//
#ifndef SHIRO_NNMETRIC_H
#define SHIRO_NNMETRIC_H
#include "mxnet-cpp/MxNetCpp.h"
using namespace mxnet::cpp;
class BV_MSE : public EvalMetric
{
public:
BV_MSE() : EvalMetric("bv_mse") {}
void Update(NDArray labels, NDArray preds) override {}
float UpdateMetric(NDArray bv_label, NDArray bv, uint32_t batch_size, uint32_t img_size);
};
class BV_CE : public EvalMetric
{
public:
BV_CE() : EvalMetric("bv_ce") {}
void Update(NDArray labels, NDArray preds) override {}
float UpdateMetric(NDArray bv_label, NDArray bv, uint32_t batch_size, uint32_t img_size);
};
class PI_MSE : public EvalMetric
{
public:
PI_MSE() : EvalMetric("pi_mse") {}
void Update(NDArray labels, NDArray preds) override {}
float UpdateMetric(NDArray policy_label, NDArray policy, uint32_t batch_size);
};
class PI_CE : public EvalMetric
{
public:
PI_CE() : EvalMetric("pi_ce") {}
void Update(NDArray labels, NDArray preds) override {}
float UpdateMetric(NDArray policy_label, NDArray policy, uint32_t batch_size);
};
class S_MSE : public EvalMetric
{
public:
S_MSE() : EvalMetric("state_mse") {}
void Update(NDArray labels, NDArray preds) override {}
float UpdateMetric(NDArray state_label, NDArray state, uint32_t batch_size, uint32_t img_size);
};
class S_CE : public EvalMetric
{
public:
S_CE() : EvalMetric("state_ce") {}
void Update(NDArray labels, NDArray preds) override {}
float UpdateMetric(NDArray state_label, NDArray state, uint32_t batch_size, uint32_t img_size);
};
class NN_LOSS : public EvalMetric
{
public:
NN_LOSS() : EvalMetric("nn_loss") {}
void Update(NDArray labels, NDArray preds) override {}
float UpdateMetric(NDArray loss, uint32_t batch_size);
};
#endif //SHIRO_NNMETRIC_H