Skip to content

Instantly share code, notes, and snippets.

@zer0n
zer0n / pytorch_hybrid.ipynb
Created February 9, 2019 05:24
LEARNING HYBRID FRONTEND SYNTAX THROUGH EXAMPLE
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zer0n
zer0n / main.personal.py
Last active May 8, 2018 22:43
Example personal main file
from train import _get_parser as get_trainer_parser, train
# Get default arguments. Then you can change the default values for a few arguments
args = get_trainer_parser().parse_args([])
args.verbose = True
train(args)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zer0n
zer0n / reclaimWindows10.ps1
Created January 8, 2017 00:45 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
+ echo Logging output to experiments/logs/rfcn_alt_opt_5step_ohem_rpn4_ResNet-101_.txt.2016-11-06_23-33-58
Logging output to experiments/logs/rfcn_alt_opt_5step_ohem_rpn4_ResNet-101_.txt.2016-11-06_23-33-58
+ ./tools/train_rfcn_alt_opt_5stage.py --gpu 4 --net_name ResNet-101 --weights data/imagenet_models/ResNet-101-model.caffemodel --imdb coco_2014_train --imdb_test coco_2014_minival --cfg experiments/cfgs/rfcn_alt_opt_5step_ohem.yml --model rfcn_alt_opt_5step_ohem
Called with args:
Namespace(cfg_file='experiments/cfgs/rfcn_alt_opt_5step_ohem.yml', gpu_id=4, imdb_name='coco_2014_train', imdb_test_name='coco_2014_minival', model_name='rfcn_alt_opt_5step_ohem', net_name='ResNet-101', pretrained_model='data/imagenet_models/ResNet-101-model.caffemodel', set_cfgs=None)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stage 0 RPN, compute normalization means and stds
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
loading annotations into memory...
Done (t=11.90s)
+ echo Logging output to experiments/logs/rfcn_end2end_ResNet-101_.txt.2016-11-07_01-23-01
Logging output to experiments/logs/rfcn_end2end_ResNet-101_.txt.2016-11-07_01-23-01
+ ./tools/train_net.py --gpu 4 --solver models/coco/ResNet-101/rfcn_end2end/solver_ohem.prototxt --weights data/imagenet_models/ResNet-101-model.caffemodel --imdb coco_2014_train --iters 490000 --cfg experiments/cfgs/rfcn_end2end_ohem.yml
Called with args:
Namespace(cfg_file='experiments/cfgs/rfcn_end2end_ohem.yml', gpu_id=4, imdb_name='coco_2014_train', max_iters=490000, pretrained_model='data/imagenet_models/ResNet-101-model.caffemodel', randomize=False, set_cfgs=None, solver='models/coco/ResNet-101/rfcn_end2end/solver_ohem.prototxt')
Using config:
{'DATA_DIR': '/home/zer0ne/src/R-FCN/data',
'DEDUP_BOXES': 0.0625,
'EPS': 1e-14,
'EXP_DIR': 'rfcn_end2end_ohem',
http://i.ytimg.com/vi/rGAqBy-D8wc/maxresdefault.jpg
http://blog.defgrip.net/wp-content/uploads/2013/08/roof1.jpg
https://scontent.cdninstagram.com/hphotos-xpf1/t51.2885-15/s320x320/e15/10808825_409571005859448_326802933_n.jpg
http://www.madpac.nl/wp-content/uploads/2015/12/Chris2-1024x684.jpg
http://thehundreds.com/wp-content/uploads/2015/01/h-big-tatt-3.jpg
http://scontent-a.cdninstagram.com/hphotos-xfp1/t51.2885-15/10375657_582076715241103_588595470_a.jpg
http://smpfreeskiercom.c.presscdn.com/wp-content/uploads/2015/09/Erik-Roner.jpg
http://41.media.tumblr.com/7f20e204983f9cef0172edc464eaebdd/tumblr_mnmyl1lxtF1qienb7o1_1280.jpg
http://www.geeksofdoom.com/GoD/img/2013/10/2013-10-12-nycc-walking-dead-steven-yeun-11.jpg
http://media-cache-ec0.pinimg.com/736x/bd/f6/58/bdf6583cbbf839aea52bc5782a70d474.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
os.environ['THEANO_FLAGS'] = 'mode=FAST_RUN,device=gpu,floatX=float32,nvcc.fastmath=True'
import theano
import time
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.optimizers import SGD