← Questions
Backpropagate through sort and divide by the median
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A function sorts a vector in ascending order and divides every element by the vector's median. Given the input and the upstream gradient of the output, return the gradient with respect to the input. Account for both paths: each element's own position in the sorted output, and the median, which feeds every output element. Aim for about O(n log n).
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
