Skip to content
Snippets Groups Projects
Commit 60abfaa7 authored by Niclas Steve Eich's avatar Niclas Steve Eich
Browse files

Comet additions

parent 283c73f2
Branches comet-features
No related tags found
No related merge requests found
......@@ -479,8 +479,6 @@ class PlotMulticlass(PlottingCallback, TFSummaryCallback):
if self.verbose:
print("PlotMulticlass-callback: Plotting {}".format(key))
plt.savefig(image_path)
if self.comet_experiment is not None:
self.comet_experiment.log_image(image_path, name=name, image_format=self.file_extension, step=epoch)
image = figure_to_image(figure)
dict.update({key: image})
......@@ -549,7 +547,8 @@ class PlotMulticlass(PlottingCallback, TFSummaryCallback):
plt.close("all")
gc.collect()
@cached_property
# @cached_property
@property
def prediction(self):
return self.model.predict(self.x, batch_size=4096)
......@@ -562,6 +561,8 @@ class PlotMulticlass(PlottingCallback, TFSummaryCallback):
class_names=self.class_names,
sample_weight=self.sample_weight_flat,
)
if self.comet_experiment is not None:
self.comet_experiment.log_figure(figure=fig, figure_name="ROC", step=epoch)
self.draw(fig, imgs, "roc_curve{}".format(name), epoch=epoch, name="ROC")
self.clear_figure(fig)
......@@ -572,6 +573,8 @@ class PlotMulticlass(PlottingCallback, TFSummaryCallback):
sample_weight=self.sample_weight_flat,
normalize="true",
)
if self.comet_experiment is not None:
self.comet_experiment.log_figure(figure=fig, figure_name="Confusion-True", step=epoch)
self.draw(fig, imgs, "confusion_matrix_true{}".format(name), epoch=epoch, name="Confusion-Matrix-True")
self.clear_figure(fig)
......@@ -582,6 +585,8 @@ class PlotMulticlass(PlottingCallback, TFSummaryCallback):
sample_weight=self.sample_weight_flat,
normalize="pred",
)
if self.comet_experiment is not None:
self.comet_experiment.log_figure(figure=fig, figure_name="Confusion-Pred", step=epoch)
self.draw(fig, imgs, "confusion_matrix_pred{}".format(name), epoch=epoch, name="Confusion-Matrix-Pred")
self.clear_figure(fig)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment