Skip to content
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

Pass parameters to plotly through report methods for customization #136

Closed
pedropalb opened this issue May 19, 2020 · 9 comments
Closed
Labels
enhancement New feature or request Feature Request Feature Request - Support w/ :+1: reaction

Comments

@pedropalb
Copy link

Hi!
I suggest you add a kwargs parameter to report methods so one can pass parameters all the way down to plotly enhancing the customization options. For example, I would like to set the axes ranges when using report_line_plot like:

logger.report_line_plot(title, series, iteration, xtitle, ytitle, xaxis_range=[0, 1])

Is it possible to do it in the current version of TRAINS?
Thanks!

@bmartinn
Copy link
Member

Thanks for the suggestion @pedropalb !
Yes, can't see any reason we could not add it.
I was thinking maybe we should add generic plotly.js layout configuration.
something like:

logger.report_line_plot(title, series, iteration, xtitle, ytitle, extra_layout={'xaxis': {'showticklabels': False, 'range': [0, 5],  'tickfont': {'color': 'magenta'}}})

What do you think?

@bmartinn bmartinn added Feature Request Feature Request - Support w/ :+1: reaction enhancement New feature or request labels May 19, 2020
@WillNichols726
Copy link

This would be a great feature! I recently saw a presentation on Weights and Biases, and you can directly log a matplotlib or plotly object. https://docs.wandb.com/library/log#custom-plots It'd be great to have that feature in Trains!

@bmartinn
Copy link
Member

bmartinn commented May 21, 2020

Thanks @WillNichols726 !
Actually matplotlib you can already directly log (see automagic example) and the same idea is being worked on for plotly objects :)

That said, I think we should push forward with additional control for the reports as suggest above, can't actually see any reason not to ...

@WillNichols726
Copy link

@bmartinn Agreed, would love to see both options in Trains one day!

For the automagic example, would that work on headless systems?

@bmartinn
Copy link
Member

Hi @WillNichols726

For the automagic example, would that work on headless systems?

If you are running your code manually (i.e. not with trains-agent) then you have to set the backend to Agg yourself, and the automagic will work.
If you are running with trains-agent , no need to worry, it will take care of it (i.e. setting the backend to Agg to allow headless execution).

@bmartinn
Copy link
Member

bmartinn commented Jun 2, 2020

@WillNichols726 good news, v0.15 is out 🎈 with this feature added
Sending a full plotly object is on the agenda for the next version :)

@WillNichols726
Copy link

@bmartinn Awesome, thanks for following up!

@pedropalb
Copy link
Author

Thanks for the new feature, @bmartinn!
Waiting for the next feature: send the full plotly object, because now, I'd like to set the stackgroup property of a go.Scatter so I can plot a probability distribution over a time series for each epoch.

@bmartinn
Copy link
Member

@pedropalb good news, the latest RC already contains the full plotly report feature, see example:

$ pip install trains==0.15.1rc0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Feature Request Feature Request - Support w/ :+1: reaction
Projects
None yet
Development

No branches or pull requests

4 participants