Skip to content

Instantly share code, notes, and snippets.

View BIGBALLON's full-sized avatar
🎯
Focusing

WILL LEE BIGBALLON

🎯
Focusing
View GitHub Profile
@BIGBALLON
BIGBALLON / VS code.md
Last active July 24, 2020 22:27
VS code setting for my ubuntu
  • extensions(插件):
    • C/C++
    • Python
    • Markdown All in One
    • Dracula Official
    • GitLens
  • settings:
    • Editor: Render Whitespace
      • boundary
  • Mouse Wheel Zoom
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import sys
import time
import random
import numpy as np
def debug_out(debug_str):
@BIGBALLON
BIGBALLON / extract_ILSVRC.sh
Created May 13, 2018 20:09
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/
@BIGBALLON
BIGBALLON / test_tanh.sh
Created April 20, 2018 18:55
paper script
# 1
python3 train.py -b 128 -e 200 -d cifar10 -lr_m tanh_epoch -net lenet -depth 5 -width 1 -tanh_begin -4 -tanh_end 4 -log ./cifar10_tb4_te4_lenet_1
python3 train.py -b 128 -e 200 -d cifar10 -lr_m tanh_epoch -net lenet -depth 5 -width 1 -tanh_begin -3.5 -tanh_end 2.5 -log ./cifar10_tb35_te25_lenet_1
python3 train.py -b 128 -e 200 -d cifar10 -lr_m tanh_epoch -net lenet -depth 5 -width 1 -tanh_begin -4 -tanh_end 2.5 -log ./cifar10_tb4_te25_lenet_1
python3 train.py -b 128 -e 200 -d cifar10 -lr_m tanh_epoch -net lenet -depth 5 -width 1 -tanh_begin -2.5 -tanh_end 2.5 -log ./cifar10_tb25_te25_lenet_1
#
python3 train.py -b 128 -e 200 -d fashion_mnist -lr_m tanh_epoch -net lenet -depth 5 -width 1 -tanh_begin -4 -tanh_end 4 -log ./fashion_mnist_tb4_te4_lenet_1
python3 train.py -b 128 -e 200 -d fashion_mnist -lr_m tanh_epoch -net lenet -depth 5 -width 1 -tanh_begin -3.5 -tanh_end 2.5 -log ./fashion_mnist_tb35_te25_lenet_1
python3 train.py -b 128 -e 200 -d fashion_mnist -lr_m tanh_epoch -net lenet -depth 5 -width 1 -ta
@BIGBALLON
BIGBALLON / stickersdown.py
Created April 17, 2018 15:07
tgram stickers download script
# *-* coding: UTF-8 *-*
__author__ = 'BG'
import urllib2
import os
import re
class ZOLPIC:
def __init__(self):
if not os.path.exists('./PIC'):
os.mkdir(r'./PIC')
@BIGBALLON
BIGBALLON / fashion_mnist_wresnet.py
Created April 17, 2018 09:52
fashion minist with wide resnet
import keras
import numpy as np
import math
from keras.datasets import fashion_mnist
from keras.preprocessing.image import ImageDataGenerator
from keras.layers.normalization import BatchNormalization
from keras.layers import Conv2D, Dense, Input, add, Activation, Flatten, AveragePooling2D
from keras.callbacks import LearningRateScheduler, TensorBoard
from keras.regularizers import l2
from keras import optimizers
@BIGBALLON
BIGBALLON / SGDR.py
Created March 16, 2018 16:02
SGDR for latest theano version.(python3)
"""
Lasagne implementation of SGDR on WRNs from "SGDR: Stochastic Gradient Descent with Restarts" (http://arxiv.org/abs/XXXX)
This code is based on Lasagne Recipes available at
https://github.com/Lasagne/Recipes/blob/master/papers/deep_residual_learning/Deep_Residual_Learning_CIFAR-10.py
and on WRNs implementation by Florian Muellerklein available at
https://gist.github.com/FlorianMuellerklein/3d9ba175038a3f2e7de3794fa303f1ee
"""
from __future__ import print_function
[global]
floatX = float32
device=cuda
optimizer=fast_run
[blas]
ldflags = -L/usr/local/lib -lopenblas
[nvcc]
fastmath = True
@BIGBALLON
BIGBALLON / BG's cheat sheet.md
Last active July 3, 2018 07:42
this is my cheat sheet for deep learning & linux
  • [Tensorflow中使用指定的GPU及GPU显存][1]
//终端执行程序时设置使用的GPU
CUDA_VISIBLE_DEVICES=1 python my_script.py

//python代码中设置使用的GPU
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
@BIGBALLON
BIGBALLON / distributed_horovod_resnet.py
Created December 7, 2017 23:24
distributed horovod example(dataset cifar10, network,resnet 32layer)
import keras
import numpy as np
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.layers.normalization import BatchNormalization
from keras.layers import Conv2D, Dense, Input, add, Activation, GlobalAveragePooling2D
from keras.callbacks import LearningRateScheduler, TensorBoard, ModelCheckpoint
from keras.models import Model
from keras import optimizers, regularizers
from keras import backend as K