Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
albertsalgueda committed Apr 6, 2022
1 parent e069631 commit 00af091
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
Binary file removed components/__pycache__/encoders.cpython-39.pyc
Binary file not shown.
Binary file removed components/__pycache__/pooler.cpython-39.pyc
Binary file not shown.
Binary file removed components/__pycache__/sdr.cpython-39.pyc
Binary file not shown.
9 changes: 9 additions & 0 deletions gridCells/gridCell.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""
Create the data structure of a gridCell, a gridCellModule, add them together.
"""

class GridCell():
def __init__(self):
pass


20 changes: 20 additions & 0 deletions viz/3d.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import matplotlib.pyplot as plt
import torch as torch

x = torch.tensor([1, 2, 3])
y = torch.tensor([4, 5, 6])

grid_x, grid_y = torch.meshgrid(x, y, indexing='ij')
grid_x
grid_y

torch.equal(torch.cat(tuple(torch.dstack([grid_x, grid_y]))),
torch.cartesian_prod(x, y))

xs = torch.linspace(-5, 5, steps=100)
ys = torch.linspace(-5, 5, steps=100)
x, y = torch.meshgrid(xs, ys, indexing='xy')
z = torch.sin(torch.sqrt(x * x + y * y))
ax = plt.axes(projection='3d')
ax.plot_surface(x.numpy(), y.numpy(), z.numpy())
plt.show()
File renamed without changes.

0 comments on commit 00af091

Please sign in to comment.