Skip to content

Instantly share code, notes, and snippets.

View kris-singh's full-sized avatar
🎯
Focusing

Kris Singh kris-singh

🎯
Focusing
View GitHub Profile
#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>
#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>
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):
/**
* @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
#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>
#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>
/* @file hidden.hpp
*
* 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_RBM_SSRBM_POLICIES_HIDDEN_HPP
#define MLPACK_METHODS_RBM_SSRBM_POLICIES_HIDDEN_HPP
#include <iostream>
class RBM
{
public:
RBM(int temp):
temp(temp)
{}
template<typename Evaluate>
int SomeFunction()
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);
#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;