MCPcopy Create free account

hub / github.com/RUSH-LAB/LSH_Memory / functions

Functions34 in github.com/RUSH-LAB/LSH_Memory

↓ 3 callersMethodbuild
(self)
memory.py:64
↓ 3 callersFunctionrandom_index
Args: seed - initial index, N - maximum index Return: A random index between [0, N] except for seed
omniglot.py:11
↓ 2 callersMethod__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 callersMethodembed
(self, x)
siamese.py:42
↓ 2 callersMethodgenerate_test
(self)
omniglot.py:208
↓ 2 callersMethodquery
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 callersFunctionrandom_uniform
(shape, low, high, cuda)
memory.py:9
↓ 2 callersMethodsample_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 callersFunctionwrite_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 callersFunctionMemoryLoss
Calculate Average Memory Loss Function positive - positive cosine similarity negative - negative cosine similarity ma
memory.py:30
↓ 1 callersFunctioncrawl_directory
Crawls data directory and returns stuff.
data_utils.py:24
↓ 1 callersFunctionflatten
Flatten matrix into a vector
memory.py:20
↓ 1 callersFunctionmaybe_download_data
Download Omniglot repo if it does not exist.
data_utils.py:115
↓ 1 callersFunctionmultiply
(x)
memory.py:17
↓ 1 callersMethodpredict
(self, x)
memory.py:70
↓ 1 callersFunctionpreprocess_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 callersFunctionresize_images
Resize images to new dimensions.
data_utils.py:51
↓ 1 callersMethodupdate
(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
Methodforward
(self, x, predict)
cnn.py:34
Methodforward
(self, x, y)
siamese.py:48
Functionindex
(batch_size, x)
memory.py:25