Skip to content

Instantly share code, notes, and snippets.

View andr0idsensei's full-sized avatar

Mihai Campean andr0idsensei

View GitHub Profile
@andr0idsensei
andr0idsensei / unvectorized_nnet.py
Last active March 15, 2021 06:45
Vectorized neural network implementation for the Coursera ML course by Andrew Ng, based on the Python implementation written by John Wittenauer here http://www.johnwittenauer.net/machine-learning-exercises-in-python-part-5/ The un-vectorized version is also available for comparison.
import numpy as np
import time
from sklearn.preprocessing import OneHotEncoder
from scipy.io import loadmat
from scipy.optimize import minimize
def load_data(filename):
""" Loads the MNIST data from the given Matlab file name. """
try: