fix to L1 prior cost computation
This commit is contained in:
parent
873817d72f
commit
07f0fa8644
@ -76,7 +76,7 @@ class Optimiser(object):
|
||||
if l2_weight > 0:
|
||||
l2_cost += 0.5 * l2_weight * numpy.sum(param**2)
|
||||
if l1_weight > 0:
|
||||
l1_cost += l1_weight * numpy.sum(numpy.sign(param))
|
||||
l1_cost += l1_weight * numpy.sum(numpy.abs(param))
|
||||
|
||||
return l1_cost, l2_cost
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user