Skip to content

Instantly share code, notes, and snippets.

@Macorreag
Macorreag / animacionconmani.ipynb
Last active Apr 3, 2021
Configuración de Colab para crear animaciones con la librería de manim
View animacionconmani.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View jacobian_hessian.py
import torch
def jacobian(y, x, create_graph=False):
jac = []
flat_y = y.reshape(-1)
grad_y = torch.zeros_like(flat_y)
for i in range(len(flat_y)):
grad_y[i] = 1.
grad_x, = torch.autograd.grad(flat_y, x, grad_y, retain_graph=True, create_graph=create_graph)
jac.append(grad_x.reshape(x.shape))
@msarahan
msarahan / DependencyGraphs.ipynb
Last active Apr 9, 2020
graphs from conda repodata.json
View DependencyGraphs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakevdp
jakevdp / VegaMagic.ipynb
Created Jan 17, 2018
Simple Vega/Vega-Lite magic function
View VegaMagic.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View how-to-make-a-racist-ai-without-really-trying.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericdill
ericdill / render_env.py
Last active May 6, 2021
Render the dependency graph for your conda environment (needs graphviz!)
View render_env.py
import json
import glob
from os.path import join, basename
# install this with "conda install -c conda-forge python-graphviz"
import graphviz as gv
# path to your conda environment
path = '/tmp/foo'
dg = gv.Digraph(filename='env-%s' % basename(path), format='svg')
@fperez
fperez / SimpleNeuralNets.ipynb
Last active May 28, 2019
Notes for "Why does deep and cheap learning work so well?" (ArXiv:1608.08225v1/cond-mat.dis-nn) by Lin and Tegmark.
View SimpleNeuralNets.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View bayesian_neural_network.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Examining Your Presence on Twitter with Python.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lispnik
lispnik / init.el
Created Feb 12, 2016
~/.emacs.d/init.el
View init.el
(if window-system
(tool-bar-mode -1)
(menu-bar-mode -1))
(when (eq window-system 'ns)
(add-to-list 'default-frame-alist '(height . 80))
(add-to-list 'default-frame-alist '(width . 132)))
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))