more lint

This commit is contained in:
npapernot 2019-07-29 22:09:21 +00:00
parent 32c76e588a
commit ed93cf6f44
4 changed files with 113 additions and 108 deletions

View file

@ -228,7 +228,9 @@ class Bolton(optimizer_v2.OptimizerV2):
return self._internal_optimizer.from_config(*args, **kwargs) return self._internal_optimizer.from_config(*args, **kwargs)
def __getattr__(self, name): def __getattr__(self, name):
"""return _internal_optimizer off self instance, and everything else """Get attr.
return _internal_optimizer off self instance, and everything else
from the _internal_optimizer instance. from the _internal_optimizer instance.
Args: Args:
@ -253,6 +255,7 @@ class Bolton(optimizer_v2.OptimizerV2):
def __setattr__(self, key, value): def __setattr__(self, key, value):
""" Set attribute to self instance if its the internal optimizer. """ Set attribute to self instance if its the internal optimizer.
Reroute everything else to the _internal_optimizer. Reroute everything else to the _internal_optimizer.
Args: Args:
@ -318,6 +321,7 @@ class Bolton(optimizer_v2.OptimizerV2):
batch_size batch_size
): ):
"""Accepts required values for bolton method from context entry point. """Accepts required values for bolton method from context entry point.
Stores them on the optimizer for use throughout fitting. Stores them on the optimizer for use throughout fitting.
Args: Args:
@ -327,7 +331,7 @@ class Bolton(optimizer_v2.OptimizerV2):
layers: list of Keras/Tensorflow layers. Can be found as model.layers layers: list of Keras/Tensorflow layers. Can be found as model.layers
class_weights: class_weights used, which may either be a scalar or 1D class_weights: class_weights used, which may either be a scalar or 1D
tensor with dim == n_classes. tensor with dim == n_classes.
n_samples number of rows/individual samples in the training set n_samples: number of rows/individual samples in the training set
batch_size: batch size used. batch_size: batch size used.
""" """
if epsilon <= 0: if epsilon <= 0:

View file

@ -558,6 +558,7 @@ class SchedulerTest(keras_parameterized.TestCase):
]) ])
def test_call(self, step, res): def test_call(self, step, res):
"""Test call. """Test call.
Test that attribute of internal optimizer is correctly rerouted to the Test that attribute of internal optimizer is correctly rerouted to the
internal optimizer internal optimizer