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
# findで見つけたファイルの最新-最古unixタイムを得るコマンド | |
echo `find [dir] [filter] -printf '%C@\n' | sort | awk 'NR==1; END{print}'` | awk '{print ($2 - $1)}' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
rsync-xargs-pull () { | |
d=$2; d=${d%/*} | |
rsync --dry-run -av $1:$2 $3 | xargs -n128 -P1 -I@ rsync -avR $1:$d/./@ $3 | |
} |
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
""" | |
python chainer_log_to_csv.py [input path] [output path] | |
""" | |
import argparse | |
import csv | |
import json | |
parser = argparse.ArgumentParser() | |
parser.add_argument('input') |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 argparse | |
import glob | |
import multiprocessing | |
import numpy | |
import tqdm | |
parser = argparse.ArgumentParser() | |
parser.add_argument('glob') | |
parser.add_argument('--processes', type=int) |
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
p=`python -c "import matplotlib; print(matplotlib.matplotlib_fname())"` | |
sed -i -e "s/backend\s*:\s*TkAgg/backend : Agg/g" $p |
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 chainer | |
class Convolution1D(chainer.links.ConvolutionND): | |
def __init__(self, in_channels, out_channels, ksize, stride=1, pad=0, | |
nobias=False, initialW=None, initial_bias=None, | |
cover_all=False): | |
super(Convolution1D, self).__init__( | |
ndim=1, | |
in_channels=in_channels, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
def concat_recursive(batch, newaxis=False): | |
""" | |
>>> from pprint import pprint | |
>>> onedata = numpy.arange(3).reshape(1, -1) | |
>>> batch = [onedata] * 4 | |
>>> pprint(concat_recursive(batch)) | |
array([[0, 1, 2], |