import numpy as np
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.
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 | |
import tensorflow as tf | |
import keras.backend as K | |
from keras.layers import Dense, Input, Dropout | |
from keras.models import Model | |
from keras.engine import Layer | |
# Reverse gradient layer from https://github.com/michetonu/gradient_reversal_keras_tf/blob/master/flipGradientTF.py | |
# - Added compute_output_shape for Keras 2 compatibility | |
# - Fixed bug where RegisterGradient was raising a KeyError |
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.
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
class Map(dict): | |
""" | |
Example: | |
m = Map({'first_name': 'Eduardo'}, last_name='Pool', age=24, sports=['Soccer']) | |
""" | |
def __init__(self, *args, **kwargs): | |
super(Map, self).__init__(*args, **kwargs) | |
for arg in args: | |
if isinstance(arg, dict): | |
for k, v in arg.items(): |
- SSH to the server where jupyterhub is installed.
- Copy the notebook extensions to your local
nbextensions
folder.
# code folding: https://github.com/ipython-contrib/IPython-notebook-extensions/wiki
jupyter nbextension install https://github.com/ipython-contrib/IPython-notebook-extensions/archive/master.zip --user
# cells vertical split, table of contents: https://github.com/Calysto/notebook-extensions
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 json | |
import re | |
import string | |
from IPython.display import display_markdown | |
class TOC: | |
def __init__(self, notebook_path): | |
""" | |
Class that builds a table of content for a given notebook. For now, it | |
only accepts markdown headers using the '#' format (e.g.: ## This is a |