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 torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from lanczos_utils import check_dist | |
EPS = float(np.finfo(np.float32).eps) | |
__all__ = ['LanczosNet'] |
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
Can not use cuDNN on context None: Disabled by dnn.enabled flag | |
Mapped name None to device cuda0: GeForce GTX 1080 Ti (0000:61:00.0) | |
11/16/2018 02:06:13 PM In order to work for big datasets fix https://github.com/Theano/Theano/pull/5721 should be applied to theano. | |
11/16/2018 02:06:13 PM loading the dataset from ./data/cmu/ | |
11/16/2018 02:06:14 PM #labels: 129 | |
11/16/2018 02:06:16 PM TfidfVectorizer(analyzer=u'word', binary=True, decode_error=u'strict', | |
dtype='float32', encoding='latin1', input=u'content', | |
lowercase=True, max_df=0.2, max_features=None, min_df=10, | |
ngram_range=(1, 1), norm='l2', preprocessor=None, smooth_idf=True, | |
stop_words='english', strip_accents=None, sublinear_tf=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
Can not use cuDNN on context None: Disabled by dnn.enabled flag | |
Mapped name None to device cuda0: GeForce GTX TITAN X (0000:83:00.0) | |
11/14/2018 02:45:18 PM In order to work for big datasets fix https://github.com/Theano/Theano/pull/5721 should be applied to theano. | |
11/14/2018 02:45:18 PM loading data from dumped file... | |
11/14/2018 02:45:18 PM loading data finished! | |
11/14/2018 02:45:18 PM stacking training, dev and test features and creating indices... | |
11/14/2018 02:45:18 PM running mlp with graph conv... | |
11/14/2018 02:45:18 PM highway is True | |
11/14/2018 02:45:18 PM Graphconv model input size 9467, output size 32 and hidden layers [300, 300, 300] regul 0.0 dropout 0.5. | |
11/14/2018 02:45:18 PM 3 gconv layers |
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
""" | |
TreeLSTM[1] implementation in Pytorch | |
Based on dynet benchmarks : | |
https://github.com/neulab/dynet-benchmark/blob/master/dynet-py/treenn.py | |
https://github.com/neulab/dynet-benchmark/blob/master/chainer/treenn.py | |
Other References: | |
https://github.com/pytorch/examples/tree/master/word_language_model | |
https://github.com/pfnet/chainer/blob/29c67fe1f2140fa8637201505b4c5e8556fad809/chainer/functions/activation/slstm.py | |
https://github.com/stanfordnlp/treelstm |
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 torch | |
from torch import nn | |
__all__ = ['FCDenseNet', 'fcdensenet_tiny', 'fcdensenet56_nodrop', | |
'fcdensenet56', 'fcdensenet67', 'fcdensenet103', | |
'fcdensenet103_nodrop'] | |
class DenseBlock(nn.Module): |