Code Monkey home page Code Monkey logo

Comments (5)

Luthaf avatar Luthaf commented on August 29, 2024

Could you write some example API? I'm not sure I see how one would use this.

from metatensor.

agoscinski avatar agoscinski commented on August 29, 2024

Basically the same slicing operations as in numpy (':5', '::2', '-1', [1,3,5,9]). these would be only allowed when components are empty, then these operations are applied on the two dimensions of samples and properties. Then it could be also applied on the gradients where the components are not touched by the slicing operation. One could probably also add support for components, but this seems more complicated for now.

from metatensor.

agoscinski avatar agoscinski commented on August 29, 2024

Okay I just learned that samples in Gradients and TensorBlock do not need to agree with each other. So the slicing would need to check that the Labels are the same, otherwise it does not work. On one hand this is a limited use case, but on the other hand it gives you back that easy numpy feeling in cases when you are just dealing with simple a block or map.

from metatensor.

Luthaf avatar Luthaf commented on August 29, 2024

I would prefer not to add operations that only work in some cases (i.e. "only if you don't have components" or "only if all gradients are exactly the same"), because they introduce arbitrary road blocks when trying to do more complex things ("why does this code fail for LODE, it worked with SOAP?"). This is especially true for code that goes inside this repository or equisolve, where we can not assume much about the data that is being stored.

If users prefer working with a single numpy array (and the data can be transformed into a single array, i.e. there are no gradients and a single block), then equistore makes it very easy to get the data out and just use an array.

from metatensor.

agoscinski avatar agoscinski commented on August 29, 2024

I see your point, and will close the issue. I still feel there is a need to simplify the slice operation in some way, even though the suggested way in this issue is probably not the right way. But I think there are other more important issues which should get the attention for the moment

from metatensor.

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.