Keras Visual Model Training process

Source: Internet
Author: User
Tags keras

Keras in the construction of neural network model and training neural network, simple and useful, summed up a few Keras API use, continuous updating. Of course, you can also learn through the Keras website. Visualization of https://keras.io/models

Save the model map as a picture.

From keras.utils import Plot_model
Plot_model (model, to_file= ' model.png ')

Plot_model receives two optional parameters:

Show_shapes: Specifies whether to display the shape of the output data, default to False
Show_layer_names: Specifies whether to display the layer name, which is true by default
visualization of the training process
history = Model.fit (Xtr_more, Ytr_more, Batch_size=batch_size, epochs=50, verbose=1, Callbacks=[earlystopping, Mcp_save, Reduce_lr_loss], validation_split=0.25) print (History.history.keys ()) FIG =
Plt.figure () Plt.plot (history.history[' acc ') plt.plot (history.history[' VAL_ACC ']) plt.title (' model accuracy ') Plt.ylabel (' accuracy ') plt.xlabel (' epoch ') plt.legend ([' Train ', ' Test '], loc= ' upper left ') Plt.plot (history.history[
' Loss ']) plt.plot (history.history[' Val_loss ') plt.title (' model loss ') Plt.ylabel (' loss ') Plt.xlabel (' epoch ') Plt.legend ([' Train ', ' Test '], loc= ' lower left ') # fig.savefig (' performance.png ') 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.