conflicts in models

This commit is contained in:
npapernot 2019-07-29 21:34:02 +00:00
parent 034ae8fea4
commit 33c3f058ac

View file

@ -81,24 +81,12 @@ class BoltonModel(Model): # pylint: disable=abstract-method
"""See super class. Default optimizer used in Bolton method is SGD. """See super class. Default optimizer used in Bolton method is SGD.
Args: Args:
<<<<<<< HEAD
optimizer:
loss:
metrics:
loss_weights:
sample_weight_mode:
weighted_metrics:
target_tensors:
distribute:
kernel_initializer:
=======
optimizer: The optimizer to use. This will be automatically wrapped optimizer: The optimizer to use. This will be automatically wrapped
with the Bolton Optimizer. with the Bolton Optimizer.
loss: The loss function to use. Must be a StrongConvex loss (extend the loss: The loss function to use. Must be a StrongConvex loss (extend the
StrongConvexMixin). StrongConvexMixin).
kernel_initializer: The kernel initializer to use for the single layer. kernel_initializer: The kernel initializer to use for the single layer.
kwargs: kwargs to keras Model.compile. See super. kwargs: kwargs to keras Model.compile. See super.
>>>>>>> 71c4a11eb9ad66a78fb13428987366887ea20beb
""" """
if not isinstance(loss, StrongConvexMixin): if not isinstance(loss, StrongConvexMixin):
raise ValueError('loss function must be a Strongly Convex and therefore ' raise ValueError('loss function must be a Strongly Convex and therefore '
@ -137,25 +125,17 @@ class BoltonModel(Model): # pylint: disable=abstract-method
4. Use a strongly convex loss function (see compile) 4. Use a strongly convex loss function (see compile)
See super implementation for more details. See super implementation for more details.
<<<<<<< HEAD
Args:
n_samples: the number of individual samples in x.
epsilon: privacy parameter, which trades off between utility an privacy.
See the bolton paper for more description.
noise_distribution: the distribution to pull noise from.
class_weight: the class weights to be used. Can be a scalar or 1D tensor
whose dim == n_classes.
=======
Args: Args:
x:
y:
batch_size:
class_weight: the class weights to be used. Can be a scalar or 1D tensor
whose dim == n_classes.
n_samples: the number of individual samples in x. n_samples: the number of individual samples in x.
epsilon: privacy parameter, which trades off between utility an privacy. epsilon: privacy parameter, which trades off between utility an privacy.
See the bolton paper for more description. See the bolton paper for more description.
noise_distribution: the distribution to pull noise from. noise_distribution: the distribution to pull noise from.
class_weight: the class weights to be used. Can be a scalar or 1D tensor steps_per_epoch:
whose dim == n_classes.
>>>>>>> 71c4a11eb9ad66a78fb13428987366887ea20beb
See the super method for descriptions on the rest of the arguments.
""" """
if class_weight is None: if class_weight is None:
class_weight_ = self.calculate_class_weights(class_weight) class_weight_ = self.calculate_class_weights(class_weight)
@ -206,8 +186,7 @@ class BoltonModel(Model): # pylint: disable=abstract-method
This method is the same as fit except for when the passed dataset This method is the same as fit except for when the passed dataset
is a generator. See super method and fit for more details. is a generator. See super method and fit for more details.
<<<<<<< HEAD
Args: Args:
generator: generator:
class_weight: the class weights to be used. Can be a scalar or 1D tensor class_weight: the class weights to be used. Can be a scalar or 1D tensor
@ -217,18 +196,6 @@ class BoltonModel(Model): # pylint: disable=abstract-method
Bolton paper for more description. Bolton paper for more description.
n_samples: number of individual samples in x n_samples: number of individual samples in x
steps_per_epoch: steps_per_epoch:
=======
Args:
n_samples: number of individual samples in x
noise_distribution: the distribution to get noise from.
epsilon: privacy parameter, which trades off utility and privacy. See
Bolton paper for more description.
class_weight: the class weights to be used. Can be a scalar or 1D tensor
whose dim == n_classes.
See the super method for descriptions on the rest of the arguments.
>>>>>>> 71c4a11eb9ad66a78fb13428987366887ea20beb
""" """
if class_weight is None: if class_weight is None:
class_weight = self.calculate_class_weights(class_weight) class_weight = self.calculate_class_weights(class_weight)
@ -262,7 +229,6 @@ class BoltonModel(Model): # pylint: disable=abstract-method
num_classes=None): num_classes=None):
"""Calculates class weighting to be used in training. """Calculates class weighting to be used in training.
<<<<<<< HEAD
Args: Args:
class_weights: str specifying type, array giving weights, or None. class_weights: str specifying type, array giving weights, or None.
class_counts: If class_weights is not None, then an array of class_counts: If class_weights is not None, then an array of
@ -271,16 +237,6 @@ class BoltonModel(Model): # pylint: disable=abstract-method
classes. classes.
Returns: Returns:
class_weights as 1D tensor, to be passed to model's fit method. class_weights as 1D tensor, to be passed to model's fit method.
=======
Args:
class_weights: str specifying type, array giving weights, or None.
class_counts: If class_weights is not None, then an array of
the number of samples for each class
num_classes: If class_weights is not None, then the number of
classes.
Returns:
class_weights as 1D tensor, to be passed to model's fit method.
>>>>>>> 71c4a11eb9ad66a78fb13428987366887ea20beb
""" """
# Value checking # Value checking
class_keys = ['balanced'] class_keys = ['balanced']