Hi, I found a differential version at post:
  
      

      Numerai Forum – 11 Mar 21
  

  
    

Differentiable Spearman in PyTorch (Optimize for CORR directly) 91

  @mdo previously showed how to use a custom loss function which involved taking the gradient of the sharpe ratio of the Pearson correlations over different eras. Although Pearson and Spearman might return similar values, it could be rewarding to...

  
    Reading time: 4 mins 🕑
      Likes: 36 ❤
  

  

  
    
    
  

  


Copying from above post:
" A recent paper, Fast Differentiable Sorting and Ranking  13, introduced a novel method for differentiable sorting and ranking, with the added bonus of O(nlogn) complexity (I would encourage reading the paper to learn more). We can leverage their open sourced code google-research/fast-soft-sort  13 in order to implement a differentiable version of the Spearman"