skorch icon indicating copy to clipboard operation
skorch copied to clipboard

compatibility with ignite metrics

Open benjamin-work opened this issue 6 years ago • 6 comments

If possible, add a scoring callback class that accepts an ignite metric as scoring function (see here).

benjamin-work avatar Apr 10 '18 14:04 benjamin-work

Hi @benjamin-work , can i start working on this?

abdulasiraj avatar Jan 14 '23 04:01 abdulasiraj

I completely forgot about this very old issue and I haven't kept up to date with the ignite development. I think one big advantage over sklearn metrics, which we already support, would be that ignite metrics are calculated on torch tensors, so they can for instance take advantage of GPU acceleration. Therefore, this could still be worth trying.

Maybe as a first step, you could try a simple metric like accuracy and create a prototype (no docs or tests necessary for that). If it looks like it could work, we can iterate from there without wasting too much time in case it's not feasible.

BenjaminBossan avatar Jan 14 '23 17:01 BenjaminBossan

sure, we can give it a try

abdulasiraj avatar Jan 15 '23 08:01 abdulasiraj

Hi @BenjaminBossan, I'm looking for contributing guide for skorch but can't find. Can you please point out?

abdulasiraj avatar Jan 17 '23 04:01 abdulasiraj

We don't have a separate contribution guide. But honestly, there isn't much to it. In the installation instructions, there is a section on how to proceed if you want to contribute. So follow this, run pytest and pylint on your newly added code and you should be good.

Given your recent PR, I assume that you're familiar with the general approach of contributing to an open source project. I.e. you know how to fork and create a PR, you know that you should stick close to the style of the existing code, etc. If you don't, just ask.

For this specific problem, I would add that:

  1. API-wise, it would be convenient for users if it were similar to that of EpochScoring, though the implementation will likely be very different.
  2. I think it makes sense to start a new module for ignite metrics inside the skorch/callbacks/ directory. Similarly, there should be a new test module, but that's for later.

The rest we can figure out on the go, which is why it's good to start with a proof of concept.

BenjaminBossan avatar Jan 17 '23 09:01 BenjaminBossan

Thanks! I thinks it's enough to start with.

abdulasiraj avatar Jan 17 '23 09:01 abdulasiraj