Skip to content

Instantly share code, notes, and snippets.

View wassname's full-sized avatar
🙃

wassname (Michael J Clark) wassname

🙃
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wassname
wassname / main.ipynb
Created March 28, 2017 00:05
Makehuman variational auto-encoder
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wassname
wassname / RangeHTTPServer.py
Last active December 25, 2018 13:49 — forked from shivakar/RangeHTTPServer.py
Python's SimpleHTTPServer extended to handle HTTP/1.1 Range requests (and pytest fixture)
"""From https://gist.github.com/shivakar/82ac5c9cb17c95500db1906600e5e1ea"""
import os
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import BaseHTTPServer
class RangeHTTPRequestHandler(SimpleHTTPRequestHandler):
"""RangeHTTPRequestHandler is a SimpleHTTPRequestHandler
@wassname
wassname / TrainIntervalLoggerTQDMNotebook.py
Last active June 30, 2017 15:04
keras-rl's TrainIntervalLogger but using tqdm for jupyter notebook
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 = []
@wassname
wassname / geojson2shapely.ipynb
Last active November 3, 2021 07:49
Convert any geojson to shapely
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wassname
wassname / pixels to pong annotated.ipynb
Created July 13, 2017 13:54
Pixels to pong annotated for deep learning group - 2017 July 13
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wassname
wassname / TrainIntervalLoggerTQDMNotebook.py
Created July 18, 2017 08:37
logging callback for keras-rl using tqdm_notebook for jupyter-notebook
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."""
@wassname
wassname / subimshow.py
Last active July 25, 2017 02:59
imshow a panel of images
import numpy as np
from matplotlib import pyplot as plt
def subimshow(image, title=''):
"""
Show each band seperately.
The shape si a square or rectangle of images
image: array of shape (channel, height, width)
@wassname
wassname / torch_summarize_with_df.py
Last active May 22, 2020 06:09
summarize a torch model like in keras, showing parameters and output shape
# summarize model
from collections import OrderedDict
import pandas as pd
import torch
from torch import nn
from torch.autograd import Variable
class TorchSummarizeDf(object):
def __init__(self, model, weights=False, input_shape=True, nb_trainable=False, debug=False):
@wassname
wassname / visualising keras loss functions.ipynb
Last active May 2, 2019 11:17
This notebook visualizes keras losses and activations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.