Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/RUSH-LAB/LSH_Memory
/ functions
Functions
34 in github.com/RUSH-LAB/LSH_Memory
⨍
Functions
34
◇
Types & classes
8
↓ 3 callers
Method
build
(self)
memory.py:64
↓ 3 callers
Function
random_index
Args: seed - initial index, N - maximum index Return: A random index between [0, N] except for seed
omniglot.py:11
↓ 2 callers
Method
__init__
Args: filepath (string): path to data file Data format - list of characters, list of images, (row, col, ch) numpy arr
omniglot.py:95
↓ 2 callers
Method
embed
(self, x)
siamese.py:42
↓ 2 callers
Method
generate_test
(self)
omniglot.py:208
↓ 2 callers
Method
query
Compute the nearest neighbor of the input queries. Arguments: x: A normalized matrix of queries of size (batch_size x ke
memory.py:87
↓ 2 callers
Function
random_uniform
(shape, low, high, cuda)
memory.py:9
↓ 2 callers
Method
sample_episode_batch
Generates a random batch for training or validation. Structures each element of the batch as an 'episode'. Each episode contains epis
omniglot.py:43
↓ 2 callers
Function
write_datafiles
Load and preprocess images from a directory and write them to a file. Args: directory: Directory of alphabet sub-directories. write_file: F
data_utils.py:63
↓ 1 callers
Function
MemoryLoss
Calculate Average Memory Loss Function positive - positive cosine similarity negative - negative cosine similarity ma
memory.py:30
↓ 1 callers
Function
crawl_directory
Crawls data directory and returns stuff.
data_utils.py:24
↓ 1 callers
Function
flatten
Flatten matrix into a vector
memory.py:20
↓ 1 callers
Function
maybe_download_data
Download Omniglot repo if it does not exist.
data_utils.py:115
↓ 1 callers
Function
multiply
(x)
memory.py:17
↓ 1 callers
Method
predict
(self, x)
memory.py:70
↓ 1 callers
Function
preprocess_omniglot
Download and prepare raw Omniglot data. Downloads the data from GitHub if it does not exist. Then load the images, augment with rotations if desi
data_utils.py:141
↓ 1 callers
Function
resize_images
Resize images to new dimensions.
data_utils.py:51
↓ 1 callers
Method
update
(self, query, y, y_hat, y_hat_indices)
memory.py:147
Method
__getitem__
(self, idx)
omniglot.py:118
Method
__getitem__
(self, idx)
omniglot.py:125
Method
__getitem__
Args: [test_image, same] = idx test_image = (test_category, test_category_image) same (bool) = if support image comes from t
omniglot.py:147
Method
__init__
(self, input_shape)
cnn.py:18
Method
__init__
(self, memory_size, key_dim, top_k = 256, inverse_temp = 40, age_noise=8.0, margin = 0.1)
memory.py:50
Method
__init__
Args: filepath (string): path to data file Data format - list of characters, list of images, (row, col, ch) numpy arr
omniglot.py:23
Method
__init__
(self, filepath)
omniglot.py:122
Method
__init__
(self, filepath)
omniglot.py:144
Method
__init__
Args: classes - number of classes in dataset rnd - number of iterations batch_size - size of batch
omniglot.py:172
Method
__init__
(self, input_shape)
siamese.py:16
Method
__iter__
(self)
omniglot.py:188
Method
__len__
(self)
omniglot.py:115
Method
__len__
(self)
omniglot.py:185
Method
forward
(self, x, predict)
cnn.py:34
Method
forward
(self, x, y)
siamese.py:48
Function
index
(batch_size, x)
memory.py:25