ETRI IVCL 1.0.0
Acceleration SW Platform for Ondevice
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Typedefs | Functions | Variables
caffe.cpp File Reference
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <cstring>
#include <map>
#include <string>
#include <vector>
#include "boost/algorithm/string.hpp"
#include "caffe/caffe.hpp"
#include "caffe/util/signal_handler.h"

Macros

#define RegisterBrewFunction(func)
 

Typedefs

typedef int(* BrewFunction) ()
 
typedef std::map< caffe::string, BrewFunctionBrewMap
 

Functions

 DEFINE_string (gpu, "", "Optional; run in GPU mode on given device IDs separated by ','." "Use '-gpu all' to run on all available GPUs. The effective training " "batch size is multiplied by the number of devices.")
 
 DEFINE_string (solver, "", "The solver definition protocol buffer text file.")
 
 DEFINE_string (model, "", "The model definition protocol buffer text file.")
 
 DEFINE_string (phase, "", "Optional; network phase (TRAIN or TEST). Only used for 'time'.")
 
 DEFINE_int32 (level, 0, "Optional; network level.")
 
 DEFINE_string (stage, "", "Optional; network stages (not to be confused with phase), " "separated by ','.")
 
 DEFINE_string (snapshot, "", "Optional; the snapshot solver state to resume training.")
 
 DEFINE_string (weights, "", "Optional; the pretrained weights to initialize finetuning, " "separated by ','. Cannot be set simultaneously with snapshot.")
 
 DEFINE_int32 (iterations, 50, "The number of iterations to run.")
 
 DEFINE_string (sigint_effect, "stop", "Optional; action to take when a SIGINT signal is received: " "snapshot, stop or none.")
 
 DEFINE_string (sighup_effect, "snapshot", "Optional; action to take when a SIGHUP signal is received: " "snapshot, stop or none.")
 
caffe::Phase get_phase_from_flags (caffe::Phase default_value)
 
vector< string > get_stages_from_flags ()
 
int device_query ()
 
 RegisterBrewFunction (device_query)
 
caffe::SolverAction::Enum GetRequestedAction (const std::string &flag_value)
 
int train ()
 
 RegisterBrewFunction (train)
 
int test ()
 
 RegisterBrewFunction (test)
 
int time ()
 
 RegisterBrewFunction (time)
 
int main (int argc, char **argv)
 

Variables

BrewMap g_brew_map
 

Macro Definition Documentation

◆ RegisterBrewFunction

#define RegisterBrewFunction (   func)
Value:
namespace { \
class __Registerer_##func { \
public: /* NOLINT */ \
__Registerer_##func() { \
g_brew_map[#func] = &func; \
} \
}; \
__Registerer_##func g_registerer_##func; \
}

Typedef Documentation

◆ BrewFunction

typedef int(* BrewFunction) ()

◆ BrewMap

typedef std::map<caffe::string, BrewFunction> BrewMap

Function Documentation

◆ DEFINE_int32() [1/2]

DEFINE_int32 ( iterations  ,
50  ,
"The number of iterations to run."   
)

◆ DEFINE_int32() [2/2]

DEFINE_int32 ( level  ,
,
"Optional; network level."   
)

◆ DEFINE_string() [1/9]

DEFINE_string ( gpu  ,
""  ,
"Optional; run in GPU mode on given device IDs separated by '  ,
'." "Use '-gpu all' to run on all available GPUs. The effective training " "batch size is multiplied by the number of devices."   
)

◆ DEFINE_string() [2/9]

DEFINE_string ( model  ,
""  ,
"The model definition protocol buffer text file."   
)

◆ DEFINE_string() [3/9]

DEFINE_string ( phase  ,
""  ,
"Optional; network phase (TRAIN or TEST). Only used for 'time'."   
)

◆ DEFINE_string() [4/9]

DEFINE_string ( sighup_effect  ,
"snapshot"  ,
"Optional; action to take when a SIGHUP signal is received: " "  snapshot,
stop or none."   
)

◆ DEFINE_string() [5/9]

DEFINE_string ( sigint_effect  ,
"stop"  ,
"Optional; action to take when a SIGINT signal is received: " "  snapshot,
stop or none."   
)

◆ DEFINE_string() [6/9]

DEFINE_string ( snapshot  ,
""  ,
"Optional; the snapshot solver state to resume training."   
)

◆ DEFINE_string() [7/9]

DEFINE_string ( solver  ,
""  ,
"The solver definition protocol buffer text file."   
)

◆ DEFINE_string() [8/9]

DEFINE_string ( stage  ,
""  ,
"Optional; network stages   not to be confused with phase,
" "separated by '  ,
'."   
)

◆ DEFINE_string() [9/9]

DEFINE_string ( weights  ,
""  ,
"Optional; the pretrained weights to initialize  finetuning,
" "separated by '  ,
'. Cannot be set simultaneously with snapshot."   
)

◆ device_query()

int device_query ( )

◆ get_phase_from_flags()

caffe::Phase get_phase_from_flags ( caffe::Phase  default_value)

◆ get_stages_from_flags()

vector< string > get_stages_from_flags ( )

◆ GetRequestedAction()

caffe::SolverAction::Enum GetRequestedAction ( const std::string &  flag_value)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ RegisterBrewFunction() [1/4]

RegisterBrewFunction ( device_query  )

◆ RegisterBrewFunction() [2/4]

RegisterBrewFunction ( test  )

◆ RegisterBrewFunction() [3/4]

RegisterBrewFunction ( time  )

◆ RegisterBrewFunction() [4/4]

RegisterBrewFunction ( train  )

◆ test()

int test ( )

◆ time()

int time ( )

◆ train()

int train ( )

Variable Documentation

◆ g_brew_map

BrewMap g_brew_map