GithubHelp home page GithubHelp logo

Comments (5)

isaaccorley avatar isaaccorley commented on August 15, 2024 1

Care to make a PR to accept a list and convert to a tensor? If not then I can take it on this weekend.

from torchgeo.

robmarkcole avatar robmarkcole commented on August 15, 2024 1

You will get to it way before me!

from torchgeo.

adamjstewart avatar adamjstewart commented on August 15, 2024 1

For a bit of history, I added this in #1221 and it initially only supported lists. In #1413, @ntw-au modified this to support lists, numpy arrays, and torch tensors. Then in #1541, I modified it to only accept torch tensors. I agree we need a way to support class_weights in a YAML file (and preferably also on the command line). If omegaconf supports this, we could also easily enable omegaconf as a parser: https://lightning.ai/docs/pytorch/stable/cli/lightning_cli_advanced_2.html#enable-variable-interpolation.

from torchgeo.

isaaccorley avatar isaaccorley commented on August 15, 2024 1

I haven't looked at the Lightning CLI in awhile but I wonder if it supports recursive instantiation like

class_weights:
   class_path: torch.tensor
   init_args:
      data: [0.5, 0.5]

from torchgeo.

isaaccorley avatar isaaccorley commented on August 15, 2024

If you want to use it with hydra.utils.instantiate and omegaconf you would only need to do the following:

class_weights:
   _target_: torch.tensor
   data: [0.5, 0.5]

from torchgeo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.