Me connecter
Pseudo
Mot de passe
Pseudo de l'auteur
Thème
Titre du sujet contenant
Message contenant
Réponses 110PAGE  ... 6   7   8   9   10   11
FORUM LE SITE Quii veut discuter je m'enuie

Shakti COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:34
bluwwz, t'arretes de draguer les travestis mineurs? z>
BlUwWz COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:35
bon je me fais chier maintenant 8>

ben moi on me dit travesti je deviens fou dsl :D :D 8>
mzelle-Sophiia COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:36
mdrrr :))
TAMPAX.HYGIENIK COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:38
Je suis en train de me pincer les tétons , c'est bien sympas en fait !
Shakti COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:38
bon, qui c'est qui veut m'apprendre à jouer à puissance 4? z>
(c'est la honte de ne pas savoir y jouer, et c'est aussi la honte de demander d'y jouer mais j'assume) z>
BlUwWz COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:39
#include <cmath>
#include <ctime>
#include <cassert>
#include <fstream>
#include <iostream>
#include <algorithm>

#include <boost/array.hpp&gt;
#include <boost/random.hpp>
#include <boost/cstdlib.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
using namespace std;
using namespace boost;
using namespace boost::numeric;


const double learning_rate = 0.1; // define learning rate
const double lambda = 0.0; // define lambda for weight decay
const unsigned int mnbatch_sz = 1250; // define size of batch
const unsigned int epoc = -1; // define number of epoch
const unsigned int midsz = 200; // define number of hiden neurons


template <typename T = double>
struct sum {
sum(const T & init = T()) : value(init) { }
void operator()(const T & val) {
value += val;
}
T value;
};

struct tanh_nl {
template <typename T>
T operator()(const T & vec) {
T res(vec.size());
for (size_t i = 0, e = vec.size(); i != e; ++i) {
res(i) = tanh(vec(i));
}
return res;
}
};

struct softmax_nl {
template <typename T>
T operator()(const T & vec) {
T tmp(vec.size());
for (size_t i = 0, e = vec.size(); i != e; ++i) {
tmp(i) = exp(vec(i));
}
typename T::value_type exp_sum =
for_each(tmp.begin(), tmp.end(),
sum<typename T::value_type>(0)).value;
T res(vec.size());
for (size_t i = 0, e = vec.size(); i != e; ++i) {
res(i) = tmp(i) / exp_sum;
}
return res;
}
};

template <int Dim, int NbClass>
class MLP_tanh_softmax
{
public:

typedef ublas::vector<double> mlp_vec;
typedef ublas::matrix<double> mlp_mat;
typedef tuple<mlp_mat, mlp_mat, // W1, W2
mlp_vec, mlp_vec> mlp_params; // b1, b2
typedef array<mlp_vec, 4> fprop_vecs;

#define PARAMS_SIZE mlp_mat(midsz, Dim), mlp_mat(NbClass, midsz), \
mlp_vec(midsz), mlp_vec(NbClass)
#define INIT_MATS(x) do { \
get<0>((x)) = ublas::zero_matrix&lt;double>(midsz, Dim); \
get<1>((x)) = ublas::zero_matrix&lt;double>(NbClass, midsz); \
} while(false)
#define INIT_VECS(x) do { \
get<2>((x)) = ublas::zero_vector&lt;double>(midsz); \
get<3>((x)) = ublas::zero_vector&lt;double>(NbClass); \
} while(false)

MLP_tanh_softmax()
{
reset();
}

void reset()
{
params = mlp_params(PARAMS_SIZE);

mt19937 rng(static_cast<boost::uint32_t>(time(0)));

// Initialisation aléatoire des paramêtres de la couche cachée dans ]-1/Dim, 1/Dim[
// Où Dim est la taille des vecteurs d'entrée
double ini = 1.0 / sqrt(double(Dim));
uniform_real<> dist1(-ini, ini);
variate_generator<;mt19937&, uniform_real<> > rand1(rng, dist1);
for (mlp_mat::array_type::iterator
it = get<0>(params).data().begin(),
end = get<0>(params).data().end();
it != end; ++it) {
*it = rand1();
}

// Initialisation aléatoire des paramêtres de la couche de sortie dans ]-1/midsz, 1/midsz[
//Où midsz est la taille de la couche cachée
ini = 1.0 / sqrt(double(midsz));
uniform_real<> dist2(-ini, ini);
variate_generator<;mt19937&, uniform_real<> > rand2(rng, dist2);
for (mlp_mat::array_type::iterator
it = get<1>(params).data().begin(),
end = get<1>(params).data().end();
it != end; ++it) {
*it = rand2();
}

// Initialisation des biais à 0
INIT_VECS(params);
}

int test(const mlp_vec & vec)
{
fprop_vecs tmp;
forward_prop(vec, tmp);
return distance(tmp[3].begin(),
max_element(tmp[3].begin(), tmp[3].end()));
}

moi je fais ça 8>
Shakti COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:40
gné? 8o
mzelle-Sophiia COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:40
mdr :))
BlUwWz COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:40
ben dsl je suis vraiment un nolife 8>
TAMPAX.HYGIENIK COMPTE SUPPRIMÉ
Mercredi 11 Mars 2009 à 18:42
J'adore bluw , du coup je bande 8>
◄ PRÉCÉDENT | SUIVANT ►