996804c052aca22d54a5206aab5c6f33552b16f7,bindsnet/pipeline/action.py,,select_softmax,#Any#,50
Before Change
if _sum == 0:
action = np.random.choice(pipeline.env.action_space.n)
else:
action = torch.multinomial((torch.exp(spikes.float()) / _sum).view(-1), 1)[0]
return action
After Change
spikes = torch.sum(pipeline.spike_record[output], dim=0)
probabilities = torch.softmax(spikes, dim=0)
return torch.multinomial(probabilities, num_samples=1).item()
def select_random(pipeline: EnvironmentPipeline, **kwargs) -> int:
// language=rst
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: BindsNET/bindsnet
Commit Name: 996804c052aca22d54a5206aab5c6f33552b16f7
Time: 2019-10-05
Author: hi@sharath.pro
File Name: bindsnet/pipeline/action.py
Class Name:
Method Name: select_softmax
Project Name: dpressel/mead-baseline
Commit Name: 6aad1de658a933d3fa376f7fe9abf419da8a8bd2
Time: 2018-11-26
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/lm/train.py
Class Name: LanguageModelTrainerPyTorch
Method Name: test
Project Name: pytorch/text
Commit Name: 812ddc9595195887b7574512bd1021743354b064
Time: 2019-08-02
Author: 6156351+zhangguanheng66@users.noreply.github.com
File Name: examples/text_classification/train.py
Class Name:
Method Name: train_and_valid