-
Notifications
You must be signed in to change notification settings - Fork 78
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
Create multiple plots in a single operation #1975
Labels
Comments
This is the code that I was running and expecting to see two plots generated: from matplotlib import pyplot as plt
from tensorflow.keras.optimizers import Adam
class TrainNodePredictor():
def __init__(self, model, learning_rate=0.005, epochs=50):
self.model = model
self.epochs = epochs
self.learning_rate = learning_rate
def execute(self, data, val_data):
optimizer = Adam(lr=self.learning_rate)
self.model.compile(optimizer=optimizer, loss='categorical_crossentropy', weighted_metrics=['acc'])
self.model.summary()
X, A, y = data
val_X, val_A, val_y = val_data
val_data = ([val_X, val_A], val_y)
unknowns = X.argmin(2)
history = self.model.fit([X, A],
y,
sample_weight=unknowns,
epochs=self.epochs,
validation_data=val_data,
shuffle=True)
plt.figure(0)
plt.plot(history.history['acc'], label='train')
plt.plot(history.history['val_acc'], label='val')
plt.title('Accuracy')
plt.xlabel('epoch')
plt.ylabel('accuracy')
plt.legend(['train', 'val'])
plt.show()
plt.figure(1)
plt.plot(history.history['loss'], label='train')
plt.plot(history.history['val_loss'], label='val')
plt.title('Loss')
plt.xlabel('epoch')
plt.ylabel('loss')
plt.legend(['train', 'val'])
plt.show()
return self.model |
The above comment is not correct. The widget already handles array of PlotlyJSONs. |
umesh-timalsina
added a commit
that referenced
this issue
Nov 11, 2020
brollb
added a commit
that referenced
this issue
Nov 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Currently, this does not appear to be supported...
The text was updated successfully, but these errors were encountered: