Skip to content

Instantly share code, notes, and snippets.

View tomascsantos's full-sized avatar

Tomas Santos tomascsantos

  • Tesla
  • Palo Alto, California
View GitHub Profile
anyio==3.5.0
appdirs==1.4.4
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
attrs==21.4.0
Babel==2.9.1
backcall==0.2.0
backports.zoneinfo==0.2.1
beautifulsoup4==4.10.0
bleach==4.1.0
anyio==3.5.0
appnope==0.1.3
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
asgiref==3.5.2
attrs==21.4.0
autobahn==22.4.2
Automat==20.2.0
Babel==2.10.1
backcall==0.2.0
alert-windows==0.6.1
appdirs==1.4.4
backcall==0.2.0
bleach==4.1.0
bokeh==2.4.2
bokehtools==0.20.1
boto3==1.18.13
botocore==1.21.64
bouncer-client==0.4.0
caspian==2.1.10.post8829.dev0
anyio==3.5.0
appnope==0.1.3
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
asgiref==3.5.2
attrs==21.4.0
autobahn==22.4.2
Automat==20.2.0
Babel==2.10.1
backcall==0.2.0
anyio==3.5.0
appdirs==1.4.4
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
attrs==21.4.0
Babel==2.9.1
backcall==0.2.0
backports.zoneinfo==0.2.1
beautifulsoup4==4.10.0
bleach==4.1.0
osx-64:
- anyio=3.5.0=py39h6e9494a_0
- appnope=0.1.3=pyhd8ed1ab_0
- argon2-cffi-bindings=21.2.0=py39h89e85a6_1
- bokeh=2.4.2=py39h6e9494a_0
- brotli-bin=1.0.9=h5eb16cf_7
- brotli=1.0.9=h5eb16cf_7
- brotlipy=0.7.0=py39h63b48b0_1004
- bzip2=1.0.8=h0d85af4_4
- c-ares=1.18.1=h0d85af4_0
class FFModel(nn.Module, BaseModel):
def __init__(self, ac_dim, ob_dim, n_layers, size, learning_rate=0.001):
super(FFModel, self).__init__()
self.ac_dim = ac_dim
self.ob_dim = ob_dim
self.n_layers = n_layers
self.size = size
self.learning_rate = learning_rate
@tomascsantos
tomascsantos / module.parameters
Created September 12, 2020 16:44
output from mean_net.parameters()
old net: Sequential(
(0): Linear(in_features=111, out_features=64, bias=True)
(1): Tanh()
(2): Linear(in_features=64, out_features=64, bias=True)
(3): Tanh()
(4): Linear(in_features=64, out_features=8, bias=True)
(5): Identity()
)
Loading expert policy from... ../policies/experts/Ant.pkl
obs (1, 111) (1, 111)
@tomascsantos
tomascsantos / tmp.py
Created May 7, 2020 20:09
Matrix Multiplication
C = np.array([
[0,1],
[0,-1],
[1,0],
[-1,0]
])
lam2 = opti.variable(C.shape[0], self.H+1) #dual variables for obstacle opt
Rot = lambda theta : np.array([
[casadi.cos(theta), -casadi.sin(theta)],
[casadi.sin(theta), casadi.cos(theta)],
def displayImage(imgArray, original):
#import original
original = plt.imread(f).astype(np.uint8)
#reshape modified to match original
imgArray = np.reshape(imgArray, original.shape)
#make sure the type is correct
imgArray = imgArray.astype(np.uint8)
newImg = Image.fromarray(imgArray)
#prepare figure: