Skip to content

Prediction plot fix #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions livelossplot/outputs/matplotlib_subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ def draw(self, *args, **kwargs):
def __call__(self, *args, **kwargs):
self.draw(*args, **kwargs)

def set_output_mode(self, mode: str):
"""Set notebook or script mode - not implemented yet"""
...



class LossSubplot(BaseSubplot):
"""To rewrire, this one now won't work"""
Expand Down Expand Up @@ -59,6 +64,7 @@ def draw(self, logs):
plt.title(self.title)
plt.xlabel('epoch')
plt.legend(loc='center right')
plt.show()


class Plot1D(BaseSubplot):
Expand All @@ -77,6 +83,7 @@ def draw(self, *args, **kwargs):
plt.plot(self.X, self.predict(self.model, self.X), '-', label="Model")
plt.title("Prediction")
plt.legend(loc='lower right')
plt.show()


class Plot2d(BaseSubplot):
Expand Down Expand Up @@ -119,3 +126,4 @@ def send(self, logger):
plt.scatter(self.X[:, 0], self.X[:, 1], c=self.Y, cmap=self.cm_points)
if self.X_test is not None:
plt.scatter(self.X_test[:, 0], self.X_test[:, 1], c=self.Y_test, cmap=self.cm_points, alpha=0.3)
plt.show()
2 changes: 2 additions & 0 deletions livelossplot/plot_losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import livelossplot
from livelossplot.main_logger import MainLogger
from livelossplot import outputs
from IPython.display import clear_output

BO = TypeVar('BO', bound=outputs.BaseOutput)

Expand Down Expand Up @@ -37,6 +38,7 @@ def update(self, *args, **kwargs):

def send(self):
"""Method will send logs to every output class"""
clear_output(wait=True)
for output in self.outputs:
output.send(self.logger)

Expand Down