This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename DecomposableFunctionType, typename DecayType = SomeValue> | |
class SGD | |
{ | |
... | |
... | |
... | |
... | |
private: | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename DecomposableFunctionType> | |
class SGD | |
{ | |
... | |
... | |
double Optimize(arma::mat& iterate); | |
template<typename Policy> | |
double Optimize(arma::mat& iterate) | |
... | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file fanin_visitor_impl.hpp | |
* @author KrishnaKant Singh | |
* | |
* Implementation of the fain layer abstraction. | |
* | |
* mlpack is free software; you may redistribute it and/or modify it under the | |
* terms of the 3-clause BSD license. You should have received a copy of the | |
* 3-clause BSD license along with mlpack. If not, see | |
* http://www.opensource.org/licenses/BSD-3-Clause for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file ffn.hpp | |
* @author Marcus Edel | |
* | |
* Definition of the FFN class, which implements feed forward neural networks. | |
* | |
* mlpack is free software; you may redistribute it and/or modify it under the | |
* terms of the 3-clause BSD license. You should have received a copy of the | |
* 3-clause BSD license along with mlpack. If not, see | |
* http://www.opensource.org/licenses/BSD-3-Clause for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file fanin_visitor_impl.hpp | |
* @author Marcus Edel | |
* @author Kris Singh | |
* | |
* Implementation of the fain layer abstraction. | |
* | |
* mlpack is free software; you may redistribute it and/or modify it under the | |
* terms of the 3-clause BSD license. You should have received a copy of the | |
* 3-clause BSD license along with mlpack. If not, see |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <mlpack/core.hpp> | |
#include <mlpack/methods/ann/ffn.hpp> | |
#include <mlpack/methods/ann/layer/layer.hpp> | |
#include <mlpack/methods/ann/layer/leaky_relu.hpp> | |
#include <mlpack/methods/ann/visitor/reset_visitor.hpp> | |
#include <mlpack/methods/ann/visitor/backward_visitor.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <mlpack/core.hpp> | |
#include <mlpack/methods/ann/ffn.hpp> | |
#include <mlpack/methods/ann/layer/layer.hpp> | |
#include <mlpack/methods/ann/layer/leaky_relu.hpp> | |
#include <mlpack/methods/ann/visitor/reset_visitor.hpp> | |
#include <mlpack/methods/ann/visitor/backward_visitor.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nestrov_update_policy.hpp | |
..... | |
arma::mat TempUpdate(arma::mat& iterate, | |
const double momentum, | |
arma::mat& velocity) | |
{ | |
return iterate + momentum*velocity; | |
} | |
...... | |
sgd.hpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FFN<NegativeLogLikelihood<> > model; | |
model.Add<Linear<> >(trainData.n_rows, hiddenLayerSize); | |
model.Add<SigmoidLayer<> >(); | |
model.Add<Linear<> >(hiddenLayerSize, outputSize); | |
model.Add<LogSoftMax<> >(); | |
MomentumUpdate momentumUpdate(0.7); | |
NoDecay noDecay; | |
SGD<decltype(model), MomentumUpdate, NoDecay> opt(model, 0.01, maxEpochs * trainData.n_cols, | |
1e-5 , true, momentumUpdate, noDecay); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template < | |
typename InputDataType = arma::mat, | |
typename OutputDataType = arma::mat | |
> | |
class AdverserialLoss | |
{ | |
public: | |
/** | |
* Create the AdverserialLoss object | |
*/ |