Skip to content

Instantly share code, notes, and snippets.

x y data
10 8.04 0
8 6.95 0
13 7.58 0
9 8.81 0
11 8.33 0
14 9.96 0
6 7.24 0
4 4.26 0
12 10.84 0
import os
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
for i in range(size):
if i == rank:
@xkumiyu
xkumiyu / VideoDataset.py
Last active September 7, 2017 16:52
Chainer Dataset of Videos
import os
import numpy as np
import six
import cv2
import chainer
def _read_video_as_array(path, dtype):
video = []
kit fox, Vulpes macrotis
English setter
Australian terrier
grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus
lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens
Egyptian cat
ibex, Capra ibex
Persian cat
cougar, puma, catamount, mountain lion, painter, panther, Felis concolor
gazelle
@xkumiyu
xkumiyu / resnet.py
Last active October 29, 2017 12:53
Chainer implementation of ResNet 18, 34, 50, 101, 152(for ImageNet), 20, 32, 44, 56, 110(for Cifar10/100).
import chainer
import chainer.functions as F
import chainer.links as L
class ResNet(chainer.Chain):
def __init__(self, n_layers, class_labels):
super(ResNet, self).__init__()
w = chainer.initializers.HeNormal()
@xkumiyu
xkumiyu / mnist_to_image.py
Last active May 12, 2023 23:14
Download and Convert MNIST binary files to image files
import argparse
import gzip
import pathlib
import struct
import numpy as np
import pandas as pd
import requests
from PIL import Image
@xkumiyu
xkumiyu / commit_message_example.md
Last active December 31, 2019 04:42 — forked from mono0926/commit_message_example.md
[転載] gitにおけるコミットログ/メッセージ例文集100
# input()
N = int(input())
A = [int(input()) for _ in range(N)]
# sys.stdin.readline()
import sys
input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]
# sort()
A.sort()
# sorted()
A = sorted(A)
# sort, lambda
A.sort(key=lambda x: x[1])
# sort, itemgetter
from operator import itemgetter
A.sort(key=itemgetter(1))
# sorted, lambda
A = sorted(A, key=lambda x: x[1])