This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import numpy.linalg as la | |
import plotly.graph_objects as go | |
def loss(x): | |
# put your loss function here | |
return x@x | |
def plot_loss_landscape(loss, directions, steps, res=25, scale=None): | |
assert(directions.shape[0] == 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.graph_objects as go | |
import torch | |
import torch.autograd.functional as autofun | |
import numpy as np | |
def loss(x): | |
return ... | |
def plot_loss_landscape(loss, directions, steps, res=25, scale=None): | |
assert(directions.shape[0] == 2) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/nicknytko/1dd749e5e3e3620ec0cc0aa8f2b70779 | |
import numpy as np | |
import pygraphviz | |
import IPython.display as ipd | |
def _render_graph(graph, layout='dot'): | |
class TempFile: | |
def __init__(self): | |
self.data = b'' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class OneTwoSixMonsters { | |
private: | |
int x, y, z; | |
public: | |
/* Declare these friend operator overloads. They are function that are not part of the class, | |
but we declare them to be friends so that they can access private variables/methods */ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function love.load() | |
love.graphics.setBackgroundColor( 255, 255, 255 ) | |
gridSize = 32 | |
gridWidth = math.floor( love.window.getWidth( ) / gridSize ) | |
gridHeight = math.floor( love.window.getHeight( ) / gridSize ) | |
grid = { } | |
for x=0, gridWidth do |