Skip to content

Instantly share code, notes, and snippets.

@andreh7
Last active March 10, 2021 15:15
Show Gist options
  • Save andreh7/701e93ec95c9822b9e307ae44eea448e to your computer and use it in GitHub Desktop.
Save andreh7/701e93ec95c9822b9e307ae44eea448e to your computer and use it in GitHub Desktop.
Learning a function with a variable number of inputs with PyTorch
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nikpocuca
Copy link

nikpocuca commented Aug 15, 2020

Replace

  absDiffFunc(np.sqrt([ np.var(x, ddof = 0) for x in inputTest]), targetTest),
  absDiffFunc(np.sqrt([ np.var(x, ddof = 1) for x in inputTest]), targetTest)

with

      absDiffFunc([ np.var(x, ddof = 0) for x in inputTest], targetTest),
      absDiffFunc([ np.var(x, ddof = 1) for x in inputTest], targetTest)

targetTest is just the variance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment