Skip to content

Conversation

@GiuseppeDiGuglielmo
Copy link
Contributor

@GiuseppeDiGuglielmo GiuseppeDiGuglielmo commented Apr 29, 2025

Description

Add accumulator precision when plotting the model information

image

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • Documentation update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • A new research paper code implementation
  • Other (Specify)

Tests

I provided a test in test/pytest/test_plot_model.py.

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have installed and run pre-commit on the files I edited or added.
  • I have added tests that prove my fix is effective or that my feature works.

@JanFSchulte
Copy link
Contributor

Hi @GiuseppeDiGuglielmo Could you check the pre-commit failure reports and fix the issues? Applies to #1281 as well.

@GiuseppeDiGuglielmo
Copy link
Contributor Author

@JanFSchulte I installed pre-commit and fixed a couple of errors.

@JanFSchulte
Copy link
Contributor

Thanks! From the screen shot it looks like the entries for the accum have a different font? I think it would be nicer if that would be unified.


def test_plot_model(convert):
# Test the plot_model function with a sample model.
output_file = "model_plot.png"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only minor, but hls4ml tends to use single quotes instead double quotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the quotes and the italic font.

@JanFSchulte JanFSchulte merged commit beec416 into main Apr 29, 2025
5 of 6 checks passed
@JanFSchulte JanFSchulte deleted the modelplot-dev branch April 29, 2025 20:12
laurilaatu pushed a commit to laurilaatu/hls4ml that referenced this pull request May 20, 2025
…chinelearning#1282)

* Add accumulator precision when plotting the model information

* Fix pre-commit flake8 errors

* Replace double quotes with single quotes

* Add both a MLP and CNN for the model plot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants