open-metric-learning icon indicating copy to clipboard operation
open-metric-learning copied to clipboard

Log metrics as bar charts

Open AlekseySh opened this issue 2 years ago • 15 comments

We may compute metrics on different categories, see docs.

The problem appears when we log and plot this metrics. They are shown on different plots, so it's hard to compare different categories. It would be great to see those metrics as bar chars for easier side-by-side comparison.

Let's update a categories example so we have a function that creates a bar chart (as an image in np format) based on provided metrics dictionary, so we can visualize it.

After it's done, we can add this functionality to Pipelines Logging.

AlekseySh avatar Aug 18 '22 22:08 AlekseySh

Hi @AlekseySh

This is my first time contributing to open source. I wanted to work on this. Can you give me a brief on what needs to be done?

Rei-Moriaty avatar Oct 08 '22 07:10 Rei-Moriaty

@Rei-Moriaty Yes, sure. If you run one of the examples (for instance, training model on INSHOP dataset) you will see a lot of graphs with metrics by different categories on Neptune. The problem now is that it's hard to find the best/worst category based on these graphs. So, if we can log them as barplot images, it would be easier to navigate, where the x-axis is the category and the y-axis is the metric. And we need a series of these images with respect to epoch number.

PS. Probably Neptune provides a way of working with bar plots, so we can avoid using images.

Some random image from the internet: Screenshot 2022-10-17 at 20 28 27

AlekseySh avatar Oct 17 '22 18:10 AlekseySh

@AlekseySh im happy to work on this if its still an active problem

but before I started was playing around on colab and ran into a problem with adding from oml.lightning.entrypoints.train import pl_train I get ModuleNotFoundError

I checked out #146 and was able to run visualization.ipynb just fine am i missing a step for oml.lightning.entrypoints.train or is that no accessible via pip install git+

isehmi avatar Nov 02 '22 19:11 isehmi

@isehmi Hi, it would be fine, because it's still an active problem

As for imports, ideally, all of the have to be accessible in collab env

  1. Do other imports work in collab?
  2. Can you do this import locally without collab?

AlekseySh avatar Nov 03 '22 09:11 AlekseySh

@AlekseySh sorry for taking so long to get back to you

when i install locally i have the same problem when i just use pip install -U open-metric-learning but i found that installing pytorch and pytorch lightning works. if this is a step that the users needs to do i recommend its added somewhere in the installation guide.

i still can't get it to work on google colab even with installing the extra modules

note this problem only exist with lightning modules from what i can tell everything else works without installing those modules

isehmi avatar Nov 07 '22 17:11 isehmi

@isehmi Hm, after what you said, I created an empty docker container with python and successfully installed the library from PIP. Which OS do you have?

AlekseySh avatar Nov 08 '22 09:11 AlekseySh

Windows 10

isehmi avatar Nov 08 '22 10:11 isehmi

@isehmi Got it. I think this is a problem. We have not tested the installation of our library for windows. Only unix-like systems. As for lightning and colab, yes, it's a known issue. That is why I added colab examples without the usage of lightning. We will investigate later how to make work lightning in colab.

AlekseySh avatar Nov 08 '22 13:11 AlekseySh

I opened the dedicated issue regarding this: https://github.com/OML-Team/open-metric-learning/issues/222

AlekseySh avatar Nov 08 '22 13:11 AlekseySh

@isehmi But I guess, it's not a blocker for you If you want to work on this issue. Because you will install the repo via git clone from your fork, not from the PIP index. I hope, in this setup, you will be able to contribute. But yep, we need to figure out what is wrong with Windows.

AlekseySh avatar Nov 08 '22 13:11 AlekseySh

@AlekseySh as I'm still working on windows I found another small bug that effects windows users should i be making issue for these or will this all be done when testing on windows systems starts

isehmi avatar Nov 11 '22 04:11 isehmi

@isehmi I think after we start testing on windows we find more, so, the creating one particular issue is not needed now

AlekseySh avatar Nov 11 '22 13:11 AlekseySh

thats what i was thinking a bit pointless adding issue one at a time. when the time comes we will need to build a robust system to catch all possible issue. i will still keep track of any problems i encounter as it might come in handy

isehmi avatar Nov 11 '22 16:11 isehmi

@isehmi that's right! thank you

AlekseySh avatar Nov 11 '22 17:11 AlekseySh

We are still looking for someone who can take care of this issue :)

AlekseySh avatar Nov 20 '22 16:11 AlekseySh