Skip to content

Instantly share code, notes, and snippets.

Avatar
🎣

UENISHI Kota kuenishi

🎣
View GitHub Profile
View gist:980f8be83a970f81b1acc4e1fe47df6e
import sys
def char(i):
'''
0-9A-Z => sp(decimal)
'''
if i >= 0 and i <= 9:
return chr(ord('0')+i)
elif i < 36:
return chr(ord('A')+i-10)
View gist:994526ce4512e143eb7ae4fc3d2ffcd1
#!/usr/bin/env python3
import re
import sys
filename = sys.argv[1]
pattern = r"(https://youtu\.be/[a-zA-Z0-9_-]*)"
with open(filename, 'r') as fp:
for line in fp.readlines():
for match in re.findall(pattern, line):
@kuenishi
kuenishi / sync.py
Last active Jun 1, 2020
Simple dotfiles manager
View sync.py
#!/usr/bin/env python3
import argparse
import difflib
import json
import os
import shutil
class LBL:
"""File handler to handle text files with line-by-line comparison"""
View concat-movies.sh
#!/bin/sh
set -eux
files=$@
cwd=`pwd`
out=`pwd`/output.mp4
echo $@
View console.log
$ NCCL_DEBUG=INFO mpirun -x NCCL_DEBUG -np 2 python3 nccl25.py
chainer-dev2:644:644 [0] NCCL INFO Bootstrap : Using [0]eth0:172.23.201.52<0>
chainer-dev2:644:644 [0] NCCL INFO NET/Plugin : No plugin found (libnccl-net.so).
chainer-dev2:644:644 [0] misc/ibvwrap.cc:212 NCCL WARN Call to ibv_open_device failed
chainer-dev2:644:644 [0] transport/net_ib.cc:120 NCCL WARN NET/IB : Unable to open device mlx5_1
chainer-dev2:644:644 [0] misc/ibvwrap.cc:212 NCCL WARN Call to ibv_open_device failed
View eval_detection4.py
import argparse
import copy
import chainer
from chainer import iterators
from chainer import function
import chainermn
from chainermn.extensions import GenericMultiNodeEvaluator
View test.rst

More example tuples of replica set representation follow

[0] 4 [{0}, {1, 2, 3}] [0, 1] 4 [{0}, {1}, {2, 3}] [0, 1], [2, 3]] 4 [{0, 1}, {2, 3}] [] 4 [{0, 1, 2, 3}] [range(0, 16, 2)] 16 [set(range(0, 16, 2)), set(range(1, 16, 2))

View multinode_snapshot.py
from chainer.training import extension
from chainer.training import extensions
class ReplicaSets:
def __init__(rank, replica_sets):
self.rank = rank
self.replica_sets = replica_sets
self.master = None
View eval_detection_multi3.py
import argparse
import copy
import chainer
from chainer import iterators
from chainer import function
import chainermn
from chainermn.extensions.multi_node_evaluator import GatherEvaluator
View eval_detection_multi2.py
import argparse
import chainer
from chainer import iterators
import chainermn
from chainermn.extensions.multi_node_evaluator import MultiNodeAggregationEvaluator
from chainercv.utils import ProgressHook
from chainercv.utils.iterator.unzip import unzip
You can’t perform that action at this time.