Skip to content

Commit

Permalink
Fix YAML serialization when using Regularizers (#2883)
Browse files Browse the repository at this point in the history
Fix #2871
  • Loading branch information
henry0312 authored and fchollet committed Jun 2, 2016
1 parent 8c84ad1 commit 882b5a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions keras/regularizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def __call__(self, loss):

def get_config(self):
return {'name': self.__class__.__name__,
'l1': self.l1,
'l2': self.l2}
'l1': float(self.l1),
'l2': float(self.l2)}


class ActivityRegularizer(Regularizer):
Expand All @@ -68,8 +68,8 @@ def __call__(self, loss):

def get_config(self):
return {'name': self.__class__.__name__,
'l1': self.l1,
'l2': self.l2}
'l1': float(self.l1),
'l2': float(self.l2)}


def l1(l=0.01):
Expand Down

0 comments on commit 882b5a1

Please sign in to comment.