View TrainIntervalLoggerTQDMNotebook.py
from rl.callbacks import Callback
from rl.callbacks import TrainIntervalLogger
from keras import backend as K
import warnings
from tqdm import tqdm_notebook
import timeit
import numpy as np
class TrainIntervalLoggerTQDMNotebook(TrainIntervalLogger):
"""TrainIntervalLogger for keras-rl using tqdm_notebook for jupyter-notebook."""
View pixels to pong annotated.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View geojson2shapely.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View TrainIntervalLoggerTQDMNotebook.py
from rl.callbacks import TrainIntervalLogger
from tqdm import tqdm_notebook
import timeit
class TrainIntervalLoggerTQDMNotebook(TrainIntervalLogger):
"""TrainIntervalLogger using tqdm_notebook for jupyter-notebook."""
def reset(self):
self.interval_start = timeit.default_timer()
self.metrics = []
self.infos = []
View RangeHTTPServer.py
"""From https://gist.github.com/shivakar/82ac5c9cb17c95500db1906600e5e1ea"""
import os
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import BaseHTTPServer
class RangeHTTPRequestHandler(SimpleHTTPRequestHandler):
"""RangeHTTPRequestHandler is a SimpleHTTPRequestHandler
View main.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View comparing_image_data_gen_streams.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View find_best_dummy_classification.py
from io import StringIO
import pandas as pd
import numpy as np
from sklearn import metrics
import sklearn
def parse_classification_report(classification_report):
"""Parse a sklearn classification report to a dict."""
return pd.read_fwf(
StringIO(classification_report),
View classification_report_parse.py
from io import StringIO
import pandas as pd
import numpy as np
import sklearn
def parse_classification_report(classification_report):
"""Parses sklearn classification report into a pandas dataframe."""
return pd.read_fwf(StringIO(classification_report),lineterminator='\n', index_col=0, colspecs=[(0,12),(12,22),(22,32),(32,42),(42,52)]).dropna()
target_names['leak','no leak']
View to_filename.py
import unicodedata
import string
valid_filename_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
def clean_filename(filename, whitelist=valid_filename_chars, replace=' '):
# replace spaces
for r in replace:
filename = filename.replace(r,'_')