fix DifferentiableSimilarity, all tests passing