Beispiel #1
0
 def init(self, params):
     return np.ones_like(params)
Beispiel #2
0
def WeightMask(target, mask_id=0, **kw):
    del kw
    if mask_id is None:
        return np.ones_like(target)
    return 1.0 - np.equal(target, mask_id).astype(np.float32)