mirror of
https://github.com/RustyRaptor/incubator-mxnet.git
synced 2026-12-04 00:05:18 -07:00
* Copy mxnet.cpp to cpp-package sub directory * Add missing type name declaration for nnvm::Tuple<dmlc::optional<int>> * Add trigger to update operation wrapper in cpp package when building mxnet * Add test to travis scripts * Disable op generation on windows
59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
/*!
|
|
* Copyright (c) 2016 by Contributors
|
|
* \file model.h
|
|
* \brief MXNET.cpp model module
|
|
* \author Zhang Chen
|
|
*/
|
|
|
|
#ifndef MXNETCPP_MODEL_H
|
|
#define MXNETCPP_MODEL_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include "mxnet-cpp/base.h"
|
|
#include "mxnet-cpp/symbol.h"
|
|
#include "mxnet-cpp/ndarray.h"
|
|
|
|
namespace mxnet {
|
|
namespace cpp {
|
|
|
|
struct FeedForwardConfig {
|
|
Symbol symbol;
|
|
std::vector<Context> ctx = {Context::cpu()};
|
|
int num_epoch = 0;
|
|
int epoch_size = 0;
|
|
std::string optimizer = "sgd";
|
|
// TODO(zhangchen-qinyinghua) More implement
|
|
// initializer=Uniform(0.01),
|
|
// numpy_batch_size=128,
|
|
// arg_params=None, aux_params=None,
|
|
// allow_extra_params=False,
|
|
// begin_epoch=0,
|
|
// **kwargs):
|
|
FeedForwardConfig(const FeedForwardConfig &other) {}
|
|
FeedForwardConfig() {}
|
|
};
|
|
class FeedForward {
|
|
public:
|
|
explicit FeedForward(const FeedForwardConfig &conf) : conf_(conf) {}
|
|
void Predict();
|
|
void Score();
|
|
void Fit();
|
|
void Save();
|
|
void Load();
|
|
static FeedForward Create();
|
|
|
|
private:
|
|
void InitParams();
|
|
void InitPredictor();
|
|
void InitIter();
|
|
void InitEvalIter();
|
|
FeedForwardConfig conf_;
|
|
};
|
|
|
|
} // namespace cpp
|
|
} // namespace mxnet
|
|
|
|
#endif /* end of include guard: MXNETCPP_MODEL_H */
|
|
|