Skip to content

Instantly share code, notes, and snippets.

@takotab
takotab / to_one_hot.py
Created October 23, 2018 12:04
one hot vector python
import numpy as np
def to_one_hot(target_vector, n_labels = None):
if n_labels is None:
n_labels = len(set(target_vector))
return np.eye(n_labels)[target_vector]
@takotab
takotab / mnist-data-size-example-of-beter-generaization.ipynb
Created November 17, 2018 09:50
MNIST data size example of beter generaization.ipynb
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.
@takotab
takotab / fastai_trouble.ipynb
Last active January 30, 2019 08:11
Please do not use this. Follow the steps as descried on the fastai data block docs.
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@takotab
takotab / export_to_saved_model.py
Created April 26, 2019 09:24
Please note it also includes stuff to use models from onnx
import tensorflow as tf
import onnx
from onnx_tf.backend import prepare
import numpy as np
import os
# from PIL import Image
def export(export_path):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Verifying my Blockstack ID is secured with the address 1HeQR1Ew72cJpiLtCS7pw1hyajP3hd9xhw https://explorer.blockstack.org/address/1HeQR1Ew72cJpiLtCS7pw1hyajP3hd9xhw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.