James Chapman

Results 100 comments of James Chapman

More generally in python you can use the__call__ method with classes so loss(args) is the same as loss__call__(args) (which is how the current loss class works).

No? Output of self() is a list Your data loader needs to have the structure that views is a key with a list of arrays.

Yeah looking at your code I think you should read what eg the DCCA class of mine is doing. It's not a loss function it's a pytorch lightning module that...

Ahhh! I've understood our confusion now! So my DCCA class 'loss' method is applied to data not representation! Apologies I thought you meant in general is the DCCA loss applied...

(Because my DCCA loss method has a forward call inside)

Have just got off a 12 hour flight so forgive me for not realising the motivation behind your Q!

If the loss function was instead called 'encode_and_calculate_loss' you would understand right? It's a bit misleading maybe but also a done thing in NN code. the function first passes raw...

This: ``` loss=DCCA().loss(batch) #batch contains dictionary with "views":list of tensors loss.backward() optimiser.step() ```

The function that takes representations and returns a scalar loss is .objective()

You're correct on the cov calls