This file contains hidden or 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 theano | |
| import theano.tensor as T | |
| import keras.backend as K | |
| import numpy as np | |
| x = T.fmatrix() | |
| mask = T.ones_like(x[:, 0]) | |
| mask = mask.dimshuffle(0, "x") | |
| mask = K.dropout(mask, 0.5) | |
| fnc = theano.function([x], mask) | |
| print fnc(np.array([[1,2,3.], [4,5,6], [7,8,9]]).astype("float32")) |
This file contains hidden or 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/env python2 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| This file that defines model factories. | |
| It is quite messy | |
| """ | |
| import logging |
This file contains hidden or 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 | |
| import numpy as np | |
| from web import embedding | |
| import web | |
| from sklearn.base import BaseEstimator, TransformerMixin | |
| from sklearn.decomposition import RandomizedPCA | |
| import logging |
This file contains hidden or 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
| Embedding(self.vocabulary_size + 1, self.word_dim, | |
| trainable=True, mask_zero=True, | |
| dropout=self.dropout, | |
| input_length=self.max_len)(sequence) | |
| forward = LSTM(self.hidden_size, return_sequences=True)(emb) | |
| backward = LSTM(self.hidden_size, go_backwards=True, return_sequences=True)(emb) | |
| merged = merge([forward, backward], mode='concat')#, concat_axis=-1) # for theano uncomment | |
| output = TimeDistributed(Dense(len(self.tag2ind), activation="softmax"))(merged) |
This file contains hidden or 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/env python | |
| """ | |
| Probability model | |
| Posterior: (2-dimensional) Normal | |
| Variational model | |
| Likelihood: Mean-field Normal | |
| """ | |
| import edward as ed | |
| import tensorflow as tf |
This file contains hidden or 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
| from scipy.stats.stats import spearmanr | |
| import numpy as np | |
| import cPickle | |
| # Same score for the second included embedding | |
| E = cPickle.load(open("Trans_embds/D_RNN_500k_144h.pkl")) | |
| data = pd.read_csv("SimLex-999/SimLex-999.txt", sep="\t") | |
| scores, golden_ratings = [], [] | |
| for _, row in data.iterrows(): |
This file contains hidden or 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 pandas as pd | |
| import json | |
| import copy | |
| def krakrobot2016_calculate_ranking(data): | |
| data = copy.deepcopy(data) | |
| def get_wins(player_a, player_b): | |
| only_ab = A_pairs[(A_pairs["id_x"] == player_a) & (A_pairs["id_y"] == player_b)] | |
| wins = only_ab[(only_ab['points_x'] > only_ab['points_y']) | \ |
This file contains hidden or 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/env python2 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Simple script running experiments from experiment_baselines only on MACCS | |
| """ | |
| import experiment_baselines_refactor | |
| import optparse | |
| from drgmum.utils import config_log_to_file | |
| from drgmum.base import LOG_DIR |
This file contains hidden or 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
| 4166 5-HT1a_actives.smi | |
| 1155 5-HT1a_inactives.smi | |
| 628 5-HT1b_actives.smi | |
| 297 5-HT1b_inactives.smi | |
| 1870 5-HT2a_actives.smi | |
| 976 5-HT2a_inactives.smi | |
| 407 5-HT2b_actives.smi | |
| 333 5-HT2b_inactives.smi | |
| 1490 5-HT6_actives.smi | |
| 341 5-HT6_inactives.smi |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder