Указание L2Regularizer при добавлении слоя приводит к ошибке компиляции - PullRequest
0 голосов
/ 29 апреля 2020

Я пытаюсь построить нейронные сети с помощью mlpack. Когда я компилирую

#include <mlpack/methods/ann/regularizer/lregularizer.hpp>
#include <mlpack/methods/ann/ffn.hpp>

using namespace mlpack;
using namespace mlpack::ann;

void ffn__train() {
    FFN<> model;
    model.Add<Linear<arma::mat, arma::mat, NoRegularizer> >();
}

, он компилируется без ошибок. Но когда я указываю L2Regularizer

#include <mlpack/methods/ann/regularizer/lregularizer.hpp>
#include <mlpack/methods/ann/ffn.hpp>

using namespace mlpack;
using namespace mlpack::ann;

void ffn__train() {
    FFN<> model;
    model.Add<Linear<arma::mat, arma::mat, L2Regularizer > >();
}

, это доставляет мне много горя:

/usr/local/include/mlpack/methods/ann/ffn.hpp:292:28: error: no matching function for call to 'std::vector<boost::variant<mlpack::ann::Add<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::AddMerge<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::AtrousConvolution<mlpack::ann::NaiveConvolution<mlpack::ann::ValidConvolution>, mlpack::ann::NaiveConvolution<mlpack::ann::FullConvolution>, mlpack::ann::NaiveConvolution<mlpack::ann::ValidConvolution>, arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::BaseLayer<mlpack::ann::LogisticFunction, arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::BaseLayer<mlpack::ann::IdentityFunction, arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::BaseLayer<mlpack::ann::TanhFunction, arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::BaseLayer<mlpack::ann::RectifierFunction, arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::BaseLayer<mlpack::ann::SoftplusFunction, arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::BatchNorm<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::BilinearInterpolation<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Concat<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Concatenate<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::ConcatPerformance<mlpack::ann::NegativeLogLikelihood<arma::Mat<double>, arma::Mat<double> >, arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Constant<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Convolution<mlpack::ann::NaiveConvolution<mlpack::ann::ValidConvolution>, mlpack::ann::NaiveConvolution<mlpack::ann::FullConvolution>, mlpack::ann::NaiveConvolution<mlpack::ann::ValidConvolution>, arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::TransposedConvolution<mlpack::ann::NaiveConvolution<mlpack::ann::ValidConvolution>, mlpack::ann::NaiveConvolution<mlpack::ann::ValidConvolution>, mlpack::ann::NaiveConvolution<mlpack::ann::ValidConvolution>, arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::DropConnect<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Dropout<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::AlphaDropout<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::ELU<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::FlexibleReLU<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Glimpse<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::HardTanH<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Highway<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Join<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::LayerNorm<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::LeakyReLU<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::CReLU<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Linear<arma::Mat<double>, arma::Mat<double>, mlpack::ann::NoRegularizer>*, mlpack::ann::LinearNoBias<arma::Mat<double>, arma::Mat<double>, mlpack::ann::NoRegularizer>*, mlpack::ann::LogSoftMax<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Lookup<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::LSTM<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::GRU<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::FastLSTM<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::MaxPooling<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::MeanPooling<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::MiniBatchDiscrimination<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::MultiplyConstant<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::MultiplyMerge<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::NegativeLogLikelihood<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Padding<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::PReLU<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::WeightNorm<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::CELU<arma::Mat<double>, arma::Mat<double> >*, boost::variant<mlpack::ann::Recurrent<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::RecurrentAttention<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::ReinforceNormal<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Reparametrization<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Select<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::Sequential<arma::Mat<double>, arma::Mat<double>, false>*, mlpack::ann::Sequential<arma::Mat<double>, arma::Mat<double>, true>*, mlpack::ann::Subview<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::VRClassReward<arma::Mat<double>, arma::Mat<double> >*, mlpack::ann::VirtualBatchNorm<arma::Mat<double>, arma::Mat<double> >*> > >::push_back(mlpack::ann::Linear<arma::Mat<double>, arma::Mat<double>, mlpack::ann::LRegularizer<2> >*)'

[more error text exceeding 30000 characters]

Я перепробовал много вещей, включая указание аргументов, но безрезультатно. Это сводится к сокращенной версии кода.

Спасибо, Майкл.

...