MCPcopy Create free account
hub / github.com/AllentDan/LibtorchSegmentation / PSPDecoderImpl

Method PSPDecoderImpl

src/architectures/PSPNetDecoder.cpp:40–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40PSPDecoderImpl::PSPDecoderImpl(std::vector<int> encoder_channels, int out_channels, double _dropout,
41 bool use_batchnorm, int _encoder_depth) {
42 encoder_depth = _encoder_depth;
43 std::vector<int> size = { 1, 2, 3, 6 };
44 psp = PSPModule(encoder_channels[encoder_depth], size, use_batchnorm);
45 conv = Conv2dReLU(encoder_channels[encoder_depth] * 2, out_channels, 1, 0, 1, use_batchnorm);
46 dropout = torch::nn::Dropout2d(torch::nn::Dropout2dOptions(_dropout));
47
48 register_module("psp", psp);
49 register_module("conv", conv);
50}
51
52torch::Tensor PSPDecoderImpl::forward(std::vector<torch::Tensor> features) {
53 auto x = features[features.size()-1];

Callers

nothing calls this directly

Calls 1

Conv2dReLUFunction · 0.85

Tested by

no test coverage detected