Skip to content

Commit 1e6c582

Browse files
Update adversarial_regularization.py
1 parent 37d60cf commit 1e6c582

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

neural_structured_learning/keras/adversarial_regularization.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import functools
2222
import types
2323
from keras.utils import traceback_utils
24+
from keras.saving import save
2425

2526
import attr
2627
import neural_structured_learning.configs as nsl_configs
@@ -695,11 +696,6 @@ def call(self, inputs, **kwargs):
695696
scaled_adv_loss, name='scaled_adversarial_loss', aggregation='mean')
696697
return outputs
697698

698-
def save(self, *args, **kwargs):
699-
raise NotImplementedError(
700-
'Saving `AdversarialRegularization` models is currently not supported. '
701-
'Consider using `save_weights` or saving the `base_model`.')
702-
703699

704700
@traceback_utils.filter_traceback
705701
def save(self,
@@ -753,8 +749,6 @@ def save(self,
753749

754750

755751

756-
757-
758752
def perturb_on_batch(self, x, **config_kwargs):
759753
"""Perturbs the given input to generates adversarial examples.
760754

0 commit comments

Comments
 (0)