Skip to content

Commit

Permalink
feature viz objectives: fix issue 131
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonin POCHE committed Oct 19, 2023
1 parent f1c7b17 commit c3ff31b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions xplique/features_visualizations/objectives.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ def compile(self) -> Tuple[tf.keras.Model, Callable, List[str], Tuple]:
def objective_function(model_outputs):
loss = 0.0
for output_index in range(0, nb_sub_objectives):
loss += self.funcs[output_index](model_outputs[output_index],
masks[output_index]) * \
multipliers[output_index]
outputs = model_outputs[output_index]
loss += self.funcs[output_index](
outputs, tf.cast(masks[output_index], outputs.dtype))
loss *= multipliers[output_index]
return loss

# the model outputs will be composed of the layers needed
Expand Down

0 comments on commit c3ff31b

Please sign in to comment.