itdxer / neupy

NeuPy is a Tensorflow based python library for prototyping and building neural networks
http://neupy.com
MIT License
741 stars 160 forks source link

Addressing issue 251: return PIL image object from plot_errors() #253

Closed DPR-Sanchez closed 5 years ago

DPR-Sanchez commented 5 years ago

Summary

This change will allow the user to have an image object passed back from calling plot_errors(), which gives the user more processing options then the current show parameter

Addresses:

https://github.com/itdxer/neupy/issues/251

Why it is useful

It will allow users more direct control of how they process the plot_errors() visual, whether it be saving to disk or placing in a GUI canvas.

Explanation of changes

Added a new parameter called image to the plot_errors() function that will funnel down to plot_optimizer_errors() and cause an image object to be returned instead of the functionality the show paramater has of having a matplotlib window open and showing the figure

How it will affect existing code

Unless the image parameter is explicitly set to True, existing code will behave exactly as before. Adds another means to bypass matplotlibs blocking behavior. Also, adds Pillow as a dependency.

Example

An example of this modification working within an application can be found below: https://github.com/DPR-Sanchez/neural-net-models/tree/canvas-feature

itdxer commented 5 years ago

Reason for the rejection has been specified here: https://github.com/itdxer/neupy/issues/251#issuecomment-524929932