Skip to content

Instantly share code, notes, and snippets.

View ImMamey's full-sized avatar
💭
I may be slow to respond.

ImMamey

💭
I may be slow to respond.
  • Venezuela
  • 18:16 (UTC -04:00)
View GitHub Profile
@ImMamey
ImMamey / draw_neural_net.py
Created October 30, 2023 04:09
Draw neural network diagram with Matplotlib and python3+
# A python 3^ version of a gist originally developed by @craffel, improved by @ljhuang2017 and @dvgodoy
import matplotlib.pyplot as plt
import numpy as np
def draw_neural_net(ax, left, right, bottom, top, layer_sizes, coefs_, intercepts_, n_iter_, loss_):
'''
Draw a neural network cartoon using matplotilb.
:usage:
>>> fig = plt.figure(figsize=(12, 12))