IBM / aihwkit

IBM Analog Hardware Acceleration Kit
https://aihwkit.readthedocs.io
MIT License
364 stars 148 forks source link

Bias term left as pytorch nn.Parameter #306

Closed Fabio-83 closed 3 years ago

Fabio-83 commented 3 years ago

Description and motivation

At present, when the bias term is requested from the layers, an additional column in the rpu_tile is created and the biases are updated during the analog backward pass, which add noise and non-idealities typical of the analog devices. In some hardware design it may be desirable to compute the bias in digital, as it would improve the overall network accuracy.

Proposed solution

Now the bias can be either compute in the analog rpu_tile or left as pytorch nn.Parameter. This behavior can be controlled by setting the digital_bias parameter of the layers to True.

maljoras commented 3 years ago

Addressed in #307