mirror of
https://github.com/IBM/ai-privacy-toolkit.git
synced 2026-04-24 20:36:21 +02:00
Add loss and optimizer as properties
Signed-off-by: abigailt <abigailt@il.ibm.com>
This commit is contained in:
parent
1385f31dcf
commit
44d012857f
1 changed files with 20 additions and 0 deletions
|
|
@ -304,8 +304,28 @@ class PyTorchClassifier(PyTorchModel):
|
|||
queries that can be submitted. Optional, Default is True.
|
||||
"""
|
||||
super().__init__(model, output_type, black_box_access, unlimited_queries, **kwargs)
|
||||
self._loss = loss
|
||||
self._optimizer = optimizer
|
||||
self._art_model = PyTorchClassifierWrapper(model, loss, input_shape, nb_classes, optimizer)
|
||||
|
||||
@property
|
||||
def loss(self):
|
||||
"""
|
||||
The pytorch model's loss function
|
||||
|
||||
:return: The pytorch model's loss function
|
||||
"""
|
||||
return self._loss
|
||||
|
||||
@property
|
||||
def optimizer(self):
|
||||
"""
|
||||
The pytorch model's optimizer
|
||||
|
||||
:return: The pytorch model's optimizer
|
||||
"""
|
||||
return self._optimizer
|
||||
|
||||
def fit(
|
||||
self,
|
||||
train_data: PytorchData,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue