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 os | |
os.environ['OMP_NUM_THREADS'] = '1' | |
import argparse | |
import resource | |
import sys | |
import time | |
import numpy as np | |
import torch | |
from torchvision.models import resnet34 |
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 os | |
os.environ['OMP_NUM_THREADS'] = '1' | |
import argparse | |
import resource | |
import sys | |
import time | |
import numpy as np | |
import torch | |
from torch import nn |
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
$ 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) |
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
$ python | |
Python 3.6.1 (dab365a46514, Feb 05 2019, 16:36:40) | |
[PyPy 7.0.0-alpha0 with GCC 6.2.0 20160901] on linux | |
$ lldb python -- -c 'import torch' | |
(lldb) target create "python" | |
Current executable set to 'python' (x86_64). | |
(lldb) settings set -- target.run-args "-c" "import torch" | |
(lldb) run | |
Process 9293 launched: '/home/kostia/ml/pytorch/pypy3.6-v7.0.0/bin/python' (x86_64) |
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 python3 | |
""" | |
Install glumpy dependencies:: | |
pip install Cython pyopengl | |
brew install glfw freetype # on OS X | |
Install glumpy:: | |
pip install glumpy |
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
video_id | group | |
---|---|---|
00WK7DR6FyPZ5u3A | 0 | |
01wO3HNwawJYADQw | 1 | |
02p3Yn87z0b5grhL | 0 | |
05RagNzyjVdXeUFR | 0 | |
06aFbpjpYHVBLJZa | 2 | |
09GA0YdSz0NvJUJx | 3 | |
0D5zA3WRD5pXjr8j | 4 | |
0EmM5wsVVNqaKNaM | 5 | |
0L5wBDT4CEazgAw6 | 6 |
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 pympler.summary import summarize, print_ | |
from pympler.muppy import get_object | |
all_objects = get_objects() | |
summary = summarize(all_objects) | |
print_(summary) |
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 typing import Dict, Any | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.linear_model import LogisticRegressionCV | |
from sklearn.pipeline import make_pipeline, FeatureUnion | |
class BaseModel: | |
def __init__(self, **kwargs): | |
self._kwargs = kwargs |
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
SELECT | |
REGEXP_EXTRACT(details.python, r"^([^\.]+)") as python_version, | |
COUNT(*) as total_downloads, | |
FROM | |
TABLE_DATE_RANGE( | |
[the-psf:pypi.downloads], | |
TIMESTAMP("20160521"), | |
TIMESTAMP("20160524") | |
) | |
WHERE |
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
!! ['Process:', 'pypy', '[30403]'] | |
!! ['Path:', '/Users/kostia/apps/netdb_demo_2/pypy/bin/pypy'] | |
!! ['Load', 'Address:', '0x100000000'] | |
!! ['Identifier:', 'pypy'] | |
!! ['Version:', '???'] | |
!! ['Code', 'Type:', 'X86-64'] | |
!! ['Parent', 'Process:', 'bash', '[26151]'] | |
!! [''] | |
!! ['Date/Time:', '2015-10-23', '17:05:13.105', '+0300'] | |
!! ['Launch', 'Time:', '2015-10-23', '17:05:12.611', '+0300'] |
NewerOlder