ctr26 / bioimage_embed

3 stars 3 forks source link

[fix] adding some prose on contrastive learning and fleshed out the loss compute (hope) #64

Closed ctr26 closed 2 weeks ago

ctr26 commented 2 weeks ago

@afoix

I've added some testing and cleaned up the contrastive loss code. I think the tests show that the function is doing as we expect.

To actually use contrastive learning in anger this way, the datasets needed to be stratified by class per batch. I'll likely add some code in as an example

ctr26 commented 2 weeks ago

Fixed the tests failing on vq I think, hoping it doesn't break something else.

Added a stratified sampler for batching, untested