def __init__(self, train_split, validate_split, randomize=True): self.train_split = check.check_gt(train_split, 0) self.validate_split = check.check_gt(validate_split, 0) if train_split <= 0 or validate_split <= 0 or train_split + validate_split >= 1: raise ValueError( "Invalid train/validate split combination: %f/%f" % (train_split, validate_split))
def with_clip_norm(self, value=None): return self._copy("clip_norm", check.check_gt(value, 0))
def with_minimum_learning_rate(self, value): return self._copy("minimum_learning_rate", check.check_gt(value, 0))
def with_converged_rate(self, value): return self._copy("converged_rate", check.check_gt(value, 0))
def clip_norm(self, value=None): if value is None: return self._clip_norm self._clip_norm = check.check_gt(value, 0) return self