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 logging | |
import pyparsing as pp | |
pp.ParserElement.enablePackrat() | |
logging.basicConfig(format='%(message)s', level=logging.DEBUG) | |
LOG = logging.getLogger() | |
def unwrap(toks): | |
if len(toks) == 1: |
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
# This file provides configuration information about non-Python dependencies for | |
# numpy.distutils-using packages. Create a file like this called "site.cfg" next | |
# to your package's setup.py file and fill in the appropriate sections. Not all | |
# packages will use all sections so you should leave out sections that your | |
# package does not use. | |
# To assist automatic installation like easy_install, the user's home directory | |
# will also be checked for the file ~/.numpy-site.cfg . | |
# The format of the file is that of the standard library's ConfigParser module. |
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 | |
import os | |
import sys | |
FC = '/usr/local/bin/gfortran' | |
newargs = [] | |
eat_next_arg = False | |
for arg in sys.argv[1:]: |
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
name: "ResNet_50_1by2_nsfw" | |
force_backward: true | |
layer { | |
name: "data" | |
type: "Input" | |
top: "data" | |
input_param { shape: { dim: 1 dim: 3 dim: 224 dim: 224 } } | |
} | |
layer { | |
name: "conv_1" |
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 python3 | |
"""Total variation denoising.""" | |
import argparse | |
import time | |
import numpy as np | |
from PIL import Image | |
from scipy.linalg import blas |
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
--[[ An experimental quasi-Newton optimizer. | |
Incorporates Hessian damping, momentum, and per-feature learning rate scaling. | |
Also implements optional polynomial-decay averaging (similar to ASGD). | |
ARGS: | |
- 'opfunc' : a function that takes a single input (X), the point | |
of a evaluation, and returns f(X) and df/dX | |
- 'x' : the initial point | |
- 'config` : a table with configuration parameters for the optimizer |
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 numpy as np | |
from scipy.linalg import blas | |
from scipy.ndimage import zoom | |
# Machine epsilon for float32 | |
EPS = np.finfo(np.float32).eps | |
# pylint: disable=no-member | |
def dot(x, y): |
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
name: "VGG_ILSVRC_16_layers_conv" | |
force_backward: true | |
layer { | |
name: "data" | |
type: "Input" | |
top: "data" | |
input_param { shape: { dim: 1 dim: 3 dim: 224 dim: 224 } } | |
} | |
layer { | |
bottom: "data" |
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 argparse | |
from functools import partial, reduce | |
import math | |
from pathlib import Path | |
import random | |
from keras.layers import * | |
from keras.models import Model | |
from keras.utils import io_utils |
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
"""Converts colors from HSL to RGB and back.""" | |
import numpy as np | |
from scipy import optimize | |
def tstack(a): | |
"""Stacks arrays in sequence along the last axis (tail).""" | |
a = np.asarray(a) | |
return np.concatenate([x[..., np.newaxis] for x in a], axis=-1) |