Skip to content

Instantly share code, notes, and snippets.

View gftabor's full-sized avatar

Griffin Tabor gftabor

  • University of Utah
View GitHub Profile
# -*- coding: utf-8 -*-
"""
Created on Sun May 10 21:50:41 2020
@author: tabor
"""
import numpy as np
import matplotlib.pyplot as plt
def speed(w1,w2):
x_direction_speed = max(abs(w1[0]),abs(w2[0]))
@gftabor
gftabor / minimization_pytorch.py
Created May 7, 2021 19:25
time testing 10 simple minimization problems in Tensorflow 1.x. Tensorflow 2.x and pytorch. tf.1x takes 0.22s, pytorch takes 1.47s, tf2.x takes 1.62s
import torch
import numpy as np
def forward(x):
clippedTheta = torch.sigmoid(x) * 720 - 360
return clippedTheta