-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
TBOutputFormat.h
45 lines (37 loc) · 1 KB
/
TBOutputFormat.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
/*
* Written (W) 2017 Giovanni De Toni
*/
#ifndef SHOGUN_OUTPUTFORMAT_H
#define SHOGUN_OUTPUTFORMAT_H
#include <shogun/base/SGObject.h>
#include <shogun/lib/any.h>
#include <tflogger/event.pb.h>
#include <utility>
namespace shogun
{
/**
* Convert an std::pair<std::string, Any> to a tensorflow::Event,
* which can be written to file and used with tools like Tensorboard.
*/
class TBOutputFormat : public CSGObject
{
public:
TBOutputFormat();
~TBOutputFormat();
/**
* Generate a tensorflow::Event object give some informations
* @param event_step the current event step
* @param value the value which will be converted to tensorflow::Event
* @param node_name the node name (default: node)
* @return the newly created tensorflow::Event
*/
tensorflow::Event convert_scalar(
const int64_t& event_step, const std::pair<std::string, Any>& value,
std::string& node_name);
virtual const char * get_name() const
{
return "TFLogger";
}
};
}
#endif // SHOGUN_OUTPUTFORMAT_H