Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个确定性神经网络,我想让它成为随机的。
两个问题:
在像以前一样计算激活之后,我现在通过以下方式运行结果数组 x:
return numpy.random.ranf(x.shape) < x
我的时机是3.03323280772e-05
3.03323280772e-05
另请注意,numpy 将布尔值视为 1 和 0,因此无需将结果传输回 int/float)。因为现在是 0 和 1,所以我不得不稍微更改我的代码 - 在我使用 -1 和 1 作为目标值和输入之前。