Chau Tung Lam Nguyen
Scrapy project - Python Software Foundation
Code Repository: https://github.com/scrapy/scurl
| $ pip install torch==1.1.0 torchvision==0.3.0 | |
| $ OMP_NUM_THREADS=1 ipython | |
| Python 3.6.7 (default, Oct 22 2018, 11:32:17) | |
| In [1]: import torch | |
| ...: from torchvision.models import resnet50 | |
| In [2]: def forward(m, x): | |
| ...: """ resnet without average pooling """ | |
| ...: x = m.conv1(x) |
Chau Tung Lam Nguyen
Scrapy project - Python Software Foundation
Code Repository: https://github.com/scrapy/scurl
| import numpy as np | |
| import marisa_trie | |
| from sklearn.feature_extraction.text import CountVectorizer | |
| from sklearn.externals import six | |
| class MarisaCountVectorizer(CountVectorizer): | |
| # ``CountVectorizer.fit`` method calls ``fit_transform`` so | |
| # ``fit`` is not provided | |
| def fit_transform(self, raw_documents, y=None): |