Skip to content

Instantly share code, notes, and snippets.

View motokimura's full-sized avatar
🏠
Working from home

Motoki Kimura motokimura

🏠
Working from home
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@motokimura
motokimura / quantization_error_simulation_of_silu.ipynb
Last active September 17, 2024 01:04
Quantization error simulation of SiLU (Swish) activation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import tensorflow as tf
def _get_values_from_tb(tb_file, key='val/aP50', values={}):
sess = tf.InteractiveSession()
with sess.as_default():
for e in tf.train.summary_iterator(tb_file):
for v in e.summary.value:
if v.tag == key:
values[e.step] = v.simple_value
return values
@motokimura
motokimura / extract_train.sh
Last active February 1, 2019 13:25
imagenet_utils
#!/bin/bash
mkdir train
mv ILSVRC2012_img_train.tar train/
cd train
tar -xvf ILSVRC2012_img_train.tar
rm -f ILSVRC2012_img_train.tar
find . -name "*.tar" | while read NAME ; do mkdir -p "${NAME%.tar}"; tar -xvf "${NAME}" -C "${NAME%.tar}"; rm -f "${NAME}"; done
@motokimura
motokimura / iou_evaluator.py
Last active December 29, 2018 05:07
Chainer's trainer extension to compute IOU of each category
import chainer
from chainer import reporter as reporter_module
from chainer.training import extensions
from chainer import function
import numpy as np
import copy
from chainercv.evaluations import eval_semantic_segmentation
class IouEvaluator(extensions.Evaluator):
@motokimura
motokimura / unet.py
Created December 22, 2018 04:38
Chainer implementation of Deep Residual U-Net
#!/usr/bin/env python
# Implementation of "Deep Residual U-Net"
# arXiv-link: https://arxiv.org/abs/1711.10684
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import initializers
@motokimura
motokimura / MyGist.md
Last active December 4, 2018 23:21
My playground for Gist

My Gist!