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 <mlpack/core.hpp> | |
#include <mlpack/core/optimizers/rmsprop/rmsprop.hpp> | |
#include <mlpack/methods/ann/init_rules/gaussian_init.hpp> | |
#include <mlpack/methods/ann/rbm/spike_slab_rbm_policy.hpp> | |
#include <mlpack/methods/ann/rbm.hpp> | |
#include <mlpack/methods/ann/rbm/binary_rbm_policy.hpp> | |
#include <mlpack/methods/softmax_regression/softmax_regression.hpp> | |
#include <mlpack/core/optimizers/minibatch_sgd/minibatch_sgd.hpp> | |
#include <mlpack/core/optimizers/sgd/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
#include <mlpack/core.hpp> | |
#include <mlpack/core/optimizers/rmsprop/rmsprop.hpp> | |
#include <mlpack/methods/ann/init_rules/gaussian_init.hpp> | |
#include <mlpack/methods/rbm/binary_layer.hpp> | |
#include <mlpack/methods/rbm/spike_slab_layer.hpp> | |
#include <mlpack/methods/rbm/rbm.hpp> | |
#include <mlpack/methods/rbm/binary_rbm.hpp> | |
#include <mlpack/methods/rbm/ssRBM.hpp> | |
#include <mlpack/methods/softmax_regression/softmax_regression.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
import numpy as np | |
import cPickle | |
def wrapper(file): | |
with open(file, 'rb') as fo: | |
dict = cPickle.load(fo) | |
return getPatches(np.array(dict['data'])) | |
def getPatches(image): |
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 gan.hpp | |
* @author Kris Singh | |
* | |
* 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. | |
*/ | |
#ifndef MLPACK_METHODS_ANN_GAN_IMPL_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 <chrono> | |
#include <mlpack/core.hpp> | |
#include <mlpack/methods/ann/layer/layer.hpp> | |
#include <mlpack/methods/ann/rbm.hpp> | |
#include <mlpack/core.hpp> | |
#include <mlpack/prereqs.hpp> | |
#include <mlpack/core/math/random.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 <mlpack/core.hpp> | |
#include <mlpack/core/optimizers/rmsprop/rmsprop.hpp> | |
#include <mlpack/methods/ann/init_rules/gaussian_init.hpp> | |
#include <mlpack/methods/rbm/binary_layer.hpp> | |
#include <mlpack/methods/rbm/spike_slab_layer.hpp> | |
#include <mlpack/methods/rbm/rbm.hpp> | |
#include <mlpack/methods/rbm/binary_rbm.hpp> | |
#include <mlpack/methods/rbm/ssRBM.hpp> | |
#include <mlpack/methods/softmax_regression/softmax_regression.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 <iostream> | |
class RBM | |
{ | |
public: | |
RBM(int temp): | |
temp(temp) | |
{} | |
template<typename Evaluate> | |
int SomeFunction() |
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
arma::mat data; | |
size_t hiddenLayerSize = 5; | |
data.randu(3, 100); | |
BinaryLayer<> visible(data.n_rows, hiddenLayerSize, 1); | |
BinaryLayer<> hidden(hiddenLayerSize, data.n_rows, 0); | |
GaussianInitialization gaussian(0, 0.1); | |
RBM<GaussianInitialization, BinaryLayer<>, BinaryLayer<> > Rbm(data, | |
gaussian, visible, hidden, 1, true, true); | |
RBM<GaussianInitialization, BinaryLayer<>, BinaryLayer<> > RbmXml(data, | |
gaussian, visible, hidden, 1, true, true); |
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 <mlpack/core.hpp> | |
#include <mlpack/methods/ann/layer/layer.hpp> | |
#include <mlpack/methods/ann/vanilla_rbm.hpp> | |
#include <mlpack/core/optimizers/cdk/cdk.hpp> | |
using namespace mlpack; | |
using namespace mlpack::ann; | |
using namespace mlpack::optimization; |