本文整理汇总了C++中OptimizerType::Function方法的典型用法代码示例。如果您正苦于以下问题:C++ OptimizerType::Function方法的具体用法?C++ OptimizerType::Function怎么用?C++ OptimizerType::Function使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptimizerType
的用法示例。
在下文中一共展示了OptimizerType::Function方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parameters
LogisticRegression<MatType>::LogisticRegression(
OptimizerType<LogisticRegressionFunction<MatType>>& optimizer) :
parameters(optimizer.Function().GetInitialPoint()),
lambda(optimizer.Function().Lambda())
{
Train(optimizer);
}
示例2: parameters
SoftmaxRegression<OptimizerType>::SoftmaxRegression(
OptimizerType<SoftmaxRegressionFunction>& optimizer) :
parameters(optimizer.Function().GetInitialPoint()),
numClasses(optimizer.Function().NumClasses()),
lambda(optimizer.Function().Lambda()),
fitIntercept(optimizer.Function().FitIntercept())
{
Train(optimizer);
}
示例3: parameters
LogisticRegression<OptimizerType>::LogisticRegression(
OptimizerType<LogisticRegressionFunction>& optimizer) :
parameters(optimizer.Function().GetInitialPoint()),
lambda(optimizer.Function().Lambda())
{
Timer::Start("logistic_regression_optimization");
const double out = optimizer.Optimize(parameters);
Timer::Stop("logistic_regression_optimization");
Log::Info << "LogisticRegression::LogisticRegression(): final objective of "
<< "trained model is " << out << "." << std::endl;
}
示例4:
void LogisticRegression<MatType>::Train(
OptimizerType<LogisticRegressionFunction<MatType>>& optimizer)
{
// Everything is good. Just train the model.
parameters = optimizer.Function().GetInitialPoint();
Timer::Start("logistic_regression_optimization");
const double out = optimizer.Optimize(parameters);
Timer::Stop("logistic_regression_optimization");
Log::Info << "LogisticRegression::LogisticRegression(): final objective of "
<< "trained model is " << out << "." << std::endl;
}
示例5: parameters
SparseAutoencoder<OptimizerType>::SparseAutoencoder(
OptimizerType<SparseAutoencoderFunction> &optimizer) :
parameters(optimizer.Function().GetInitialPoint()),
visibleSize(optimizer.Function().VisibleSize()),
hiddenSize(optimizer.Function().HiddenSize()),
lambda(optimizer.Function().Lambda()),
beta(optimizer.Function().Beta()),
rho(optimizer.Function().Rho())
{
Timer::Start("sparse_autoencoder_optimization");
const double out = optimizer.Optimize(parameters);
Timer::Stop("sparse_autoencoder_optimization");
Log::Info << "SparseAutoencoder::SparseAutoencoder(): final objective of "
<< "trained model is " << out << "." << std::endl;
}