Skip to content

Instantly share code, notes, and snippets.

View kmader's full-sized avatar

Kevin Mader kmader

  • Zurich, Switzerland
View GitHub Profile
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>IPyVolume Widget</title>
</head>
<body>
@kmader
kmader / prep_convert.py
Last active February 18, 2020 08:10
Convert a preprocessing function into a convolutional layer (in Keras). It takes an input from -127 to 127 and runs it through the preprocess_input function and then returns a convolutional layer with the appropriate weights and biases to reproduce (as closely as possible) the preprocessing step. This allows models to be packaged without worryin…
from keras.applications.mobilenet_v2 import MobileNetV2, preprocess_input
from keras import layers, models
from sklearn.linear_model import LinearRegression
import numpy as np
def prep_to_conv(
in_prep_func: Callable[[np.array], np.array],
*,
min_val: float=-127,
max_val: float=127,
@kmader
kmader / freeze_parameters.ipynb
Created December 5, 2019 14:26
How to freeze parameters in a model using pytorch
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / 00215.tif
Last active November 28, 2019 14:01
Tiff Read Error in skimage
library(quantmod)
library(rvest)
table_id <- 3
url <- "https://en.wikipedia.org/wiki/S%26P_100"
sp100 <- url %>%
read_html() %>%
html_nodes("table") %>%
.[[table_id]] %>%
html_table()
@kmader
kmader / a-greenland-ice-melting-graph.ipynb
Last active August 5, 2019 14:38
Greenland Surface Melt Extent, the NSIDC has a very interesting melt-chart but unfortunately doesn't quite show all the steps taken to make it. So here we attempt to reproduce the chart from the raw data by pulling it all from their API. ## Acknowledgements - Greenland Ice Sheet Today is produced at the National Snow and Ice Data Center by Ted S…
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / README.md
Last active March 27, 2019 09:31
Dummy Model

Overview

@kmader
kmader / environment.yml
Last active March 22, 2019 21:42
Out of order bug
name: plotly_express
dependencies:
- python=3.5
- numpy
- matplotlib
- pandas
- scikit-learn
- pip:
- plotly==3.7.1
- plotly_express
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / CornerstoneDemo.ipynb
Created August 30, 2018 13:50
Cornerstone Demo Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.