This file contains hidden or 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
| from keras.callbacks import Callback | |
| import keras.backend as K | |
| import numpy as np | |
| class SGDRScheduler(Callback): | |
| '''Cosine annealing learning rate scheduler with periodic restarts. | |
| # Usage | |
| ```python | |
| schedule = SGDRScheduler(min_lr=1e-5, |
This file contains hidden or 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 graphviz | |
| import numpy as np | |
| import keras | |
| def gather_layer_stats(layer_dict, layer, r, s): | |
| lr, ls = None, None | |
| if hasattr(layer, 'kernel_size'): | |
| assert layer.kernel_size[0] == layer.kernel_size[1] | |
| assert layer.strides[0] == layer.strides[1] |
This file contains hidden or 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 | |
| import tensorflow as tf | |
| __author__ = "Sangwoong Yoon" | |
| def np_to_tfrecords(X, Y, file_path_prefix, verbose=True): | |
| """ | |
| Converts a Numpy array (or two Numpy arrays) into a tfrecord file. | |
| For supervised learning, feed training inputs to X and training labels to Y. | |
| For unsupervised learning, only feed training inputs to X, and feed None to Y. |
This file contains hidden or 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
| # docker build -t ubuntu1604py36 | |
| FROM ubuntu:16.04 | |
| RUN apt-get update && \ | |
| apt-get install -y software-properties-common && \ | |
| add-apt-repository ppa:jonathonf/python-3.6 | |
| RUN apt-get update | |
| RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv | |
| RUN apt-get install -y git |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <title>title</title> | |
| <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> | |
| <link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet"/> | |
| <script src="http://code.jquery.com/jquery-2.0.3.min.js"></script> |