- extensions(插件):
- C/C++
- Python
- Markdown All in One
- Dracula Official
- GitLens
- settings:
- Editor: Render Whitespace
- boundary
- Editor: Render Whitespace
- Mouse Wheel Zoom
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import os | |
import sys | |
import time | |
import random | |
import numpy as np | |
def debug_out(debug_str): |
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
#!/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/ |
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
# 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 |
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
# *-* 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') |
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 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 |
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
""" | |
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 |
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
[global] | |
floatX = float32 | |
device=cuda | |
optimizer=fast_run | |
[blas] | |
ldflags = -L/usr/local/lib -lopenblas | |
[nvcc] | |
fastmath = True |
- [Tensorflow中使用指定的GPU及GPU显存][1]
//终端执行程序时设置使用的GPU
CUDA_VISIBLE_DEVICES=1 python my_script.py
//python代码中设置使用的GPU
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
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 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 |