049c293a83ba05d11956568a5c1835757a09e4ef,dnc/sparse_memory.py,SparseMemory,read_from_sparse_memory,#SparseMemory#Any#Any#Any#Any#,142
Before Change
distances = distances / max(distances)
read_weights.append(distances)
read_positions.append(positions)
// add weight of 0 for least used mem block
read_weights = T.stack(read_weights, 0)
read_weights = T.cat([read_weights, read_weights.new(b, 1, 1)], 2)
After Change
for batch in range(b):
distances, positions = indexes[batch].search(keys[batch])
distances = F.softmax(distances)
read_weights.append(distances)
read_positions.append(T.clamp(positions, 0, self.mem_size-1))
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 5
Instances
Project Name: ixaxaar/pytorch-dnc
Commit Name: 049c293a83ba05d11956568a5c1835757a09e4ef
Time: 2017-11-30
Author: root@ixaxaar.in
File Name: dnc/sparse_memory.py
Class Name: SparseMemory
Method Name: read_from_sparse_memory
Project Name: Microsoft/nni
Commit Name: 1cada380ff768d6e59aa4089734cbed74014b9bb
Time: 2019-11-17
Author: v-yugzh@microsoft.com
File Name: src/sdk/pynni/nni/nas/pytorch/enas/mutator.py
Class Name: EnasMutator
Method Name: on_calc_input_choice_mask
Project Name: NeuromorphicProcessorProject/snn_toolbox
Commit Name: e22aef4d42d1d20a093240933181f627dcd830e7
Time: 2016-10-13
Author: bodo.rueckauer@gmail.com
File Name: snntoolbox/core/inisim.py
Class Name:
Method Name: softmax_activation
Project Name: ixaxaar/pytorch-dnc
Commit Name: a6667bf98c59a7447a6bc55869459e83f5bdb603
Time: 2017-12-07
Author: root@ixaxaar.in
File Name: dnc/sparse_memory.py
Class Name: SparseMemory
Method Name: read_from_sparse_memory
Project Name: dmlc/dgl
Commit Name: 91cb347719da745fe0bd309607ce1c272604acdb
Time: 2021-03-09
Author: lygztq@gmail.com
File Name: examples/pytorch/diffpool/model/dgl_layers/gnn.py
Class Name: DiffPoolBatchedGraphLayer
Method Name: forward