Skip to content

Unable to use corrcoef (using v1.0.7) #31

@houstonhaynes

Description

@houstonhaynes

Unable to use corrcoef (using v1.0.7)

Issue #438 | Created by @Nexus452 | 2022-09-19 17:28:21 UTC |

Hi,

Looking at the doc : https://diffsharp.github.io/reference/diffsharp-tensor.html#corrcoef, the function should be available out of the box, however for some reason it is unavailable (intellisense + compile error).
In the doc, this function is between convTranspose3d and cos. Both functions are available to me (intellisense )
I have decompiled DiffSharp.Core and searched for corrcoef but I really can't find it.

Any idea what I should do to be able to use corrcoef ?

Thanks,
S

2022-09-20 01_26_32-FsTimeSerie - Microsoft Visual Studio


Comment by @nhirschey | 2022-10-10 10:59:07 UTC

While it is in the docs, the library version with corrcoef is not yet released on nuget. The nuget version is from just before the PR adding corrcoef was merged in.

If you build a local version of DiffSharp and reference it directly, like below (changing the #I path), it will be there:

#I @"C:\Users\nexus452\Documents\GitHub\DiffSharp\bundles\DiffSharp-cpu\bin\Debug\net6.0"
#r "DiffSharp.Core.dll"
#r "DiffSharp.Data.dll"
#r "DiffSharp.Backends.Torch.dll"
#r "nuget: TorchSharp-cuda-windows, 0.96.0"


open DiffSharp
open DiffSharp.Compose
open DiffSharp.Model

open DiffSharp

let loss (x: Tensor, y: Tensor) = 
    let xy = dsharp.stack [|x; y|]
    xy.corrcoef().sum()

Status: Open

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions