MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / MLP

Class MLP

lesson3-BasicModels/MLP.h:6–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include<BaseModule.h>
5
6class MLP: public torch::nn::Module{
7public:
8 MLP(int in_features, int out_features);
9 torch::Tensor forward(torch::Tensor x);
10private:
11 int mid_features[3] = {32,64,128};
12 LinearBnRelu ln1{nullptr};
13 LinearBnRelu ln2{nullptr};
14 LinearBnRelu ln3{nullptr};
15 torch::nn::Linear out_ln{nullptr};
16};

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected