(Et pour voir les départements les plus accueillants, c'est ici: https://gist.github.com/cerisara/928ad03cf15c77dda8897c2cf49ef27d )
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
/** | |
* Iterative reduce with | |
* flat map using map partitions | |
* | |
* @author Adam Gibson | |
modified by Christophe Cerisara | |
*/ | |
public class IterativeReduceFlatMap implements FlatMapFunction<Iterator<DataSet>, INDArray> { |
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
# X_train contains word indices (single int between 0 and max_words) | |
# Y_train0 contains class indices (single int between 0 and nb_classes) | |
X_train = sequence.pad_sequences(X_train, maxlen=maxlen, padding='post') | |
X_test = sequence.pad_sequences(X_test, maxlen=maxlen, padding='post') | |
Y_train = np.zeros((batchSize,globvars.nb_classes))#,dtype=np.float32) | |
for t in range(batchSize): | |
Y_train[t][Y_train0[t]]=1 | |
Y_test = np.zeros((len(Y_test0),globvars.nb_classes))#,dtype=np.float32) |
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 matplotlib.pyplot as plt | |
from keras.models import Sequential | |
from keras.layers.core import Dense, Activation | |
from keras.optimizers import SGD | |
from sklearn.metrics import mean_squared_error | |
tau=2*np.pi |
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
complete_sentences = [["*-START-*"] for a in range(1000)] | |
sents = np.zeros((nb_samples, timesteps+1, len(vocab))) | |
for x in range(nb_samples): | |
sents[i,0,word2index["*-START-*"]] = 1. # init the sequences | |
for t in range(timesteps): | |
preds = self.model.predict(sents[:,0:t+1], verbose=0) | |
# get the maximum predictions for this timestep for each sample | |
next_word_indices = np.argmax(preds[:,t], axis=1) |
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 | |
from keras.preprocessing import sequence | |
from keras.models import Sequential | |
from keras.layers.core import Dense, Dropout, Activation, Flatten, TimeDistributedDense | |
from keras.layers.recurrent import LSTM | |
from keras.layers.embeddings import Embedding | |
from keras.utils import np_utils | |
from keras.preprocessing.text import Tokenizer | |
from keras.models import Graph |
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
#!/usr/bin/php -qC | |
<?php | |
/****************************************************************************** | |
* | |
* @file gitolab.php | |
* @author Benoit Zohar | |
* @link http://benoitzohar.fr/ | |
* @last-edited 2015-01-09 | |
* @description Migrate projects from Gitolite to GitLab |
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
Data Parallelization with multi-GPU over TensorFlow | |
Jonathan Laserson <jonilaserson@gmail.com> | |
9 oct. (Il y a 2 jours) | |
À Keras-users Se désabonner | |
Here is how to take an existing model and do data parallelization across multiple GPUs. |
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 sys | |
def getText(l): | |
l=l.replace('\\citep','') | |
l=l.replace('\\cite','') | |
return l | |
with open(sys.argv[1],'rb') as f : ls = f.readlines() | |
empty=False |
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
#!/bin/bash | |
# arxiv paper ID | |
python2 getarxivid.py $1 > arxivids | |
mkdir papers | |
for i in $(cat arxivids) | |
do |
OlderNewer