Skip to content

Commit 81b520a

Browse files
committed
Updated assertionexception.
1 parent b178468 commit 81b520a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/model/stdpScheme.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ def stdp_dw(time_diff:float, scale_factor:float=0.02,
4848
if np.less_equal(time_diff, 0):
4949
dw = (scale_factor
5050
* np.exp( time_diff / tau_plus))
51-
if dw <= 0:
52-
raise AssertionError(f"During LTP, dw should be > 0, it is {dw}")
51+
if dw < 0:
52+
raise AssertionError(f"During LTP, dw should be >= 0, it is {dw}")
5353

5454
## Case: LTD (Long-term depression)
5555
if np.greater(time_diff, 0):
5656
dw = (scale_factor
5757
* -(stdp_beta / tau_r)
5858
* np.exp( -time_diff / tau_neg ))
59-
if dw >= 0:
60-
raise AssertionError(f"During LTD, dw should be < 0, it is {dw}")
59+
if dw > 0:
60+
raise AssertionError(f"During LTD, dw should be <= 0, it is {dw}")
6161

6262
return dw
6363

0 commit comments

Comments
 (0)