haeusser / learning_by_association

This repository contains code for the paper Learning by Association - A versatile semi-supervised training method for neural networks (CVPR 2017) and the follow-up work Associative Domain Adaptation (ICCV 2017).
https://vision.in.tum.de/members/haeusser
Apache License 2.0
151 stars 63 forks source link

Backpropagation #9

Closed jessicaloohw closed 7 years ago

jessicaloohw commented 7 years ago

How would I calculate the backpropagation through the loss layer i.e. the derivative of the loss w.r.t. the embeddings, A and B? I am trying to implement this in MatConvNet, which requires me to code the backward pass.

haeusser commented 7 years ago

The loss is simple cross entropy: https://github.com/haeusser/learning_by_association/blob/master/semisup/backend.py#L179

I personally would suggest to use a scalable framework with auto-differentiation such as PyTorch, Caffe2, Torch, Theano, younameit.