Git Product home page Git Product logo

Comments (3)

jiaoyining avatar jiaoyining commented on June 14, 2024

Thanks for asking.
In the code this is the function for getting the displacement:

def get_displacement_per_covariate(self, enc_coords, embedding, covaraite, which_covariate, whether_inv=False, training=True):

        embedding_with_attri = torch.cat((covaraite, embedding), dim=-1)
        if training:
            embedding_with_zeros = torch.cat((torch.randn_like(covaraite)*1e-3, embedding), dim=-1)
        else:
            embedding_with_zeros = torch.cat((torch.zeros_like(covaraite) * 1e-3, embedding), dim=-1)

        arr_disp = self.net_direction[which_covariate](embedding_with_attri, enc_coords) - self.net_direction[which_covariate](embedding_with_zeros, enc_coords)
        if not whether_inv:
            return arr_disp
        else:
            return -arr_disp

self.net_direction() is the f(p, x, z), x is a single covariate for example age.
and arr_disp give the covariate-wise displacement, which is gi(p, x, y, z) = fi(p, x, z) − fi(p, y, z). In this case, y is set to 0 so you get gi=0 when x=0.
During training, we add an extremely small value to 0 as embedding_with_zeros = torch.cat((torch.randn_like(covaraite)*1e-3, embedding), dim=-1) as data augmentation for robustness.

Hope it helps.

from naisr.

WangJYao avatar WangJYao commented on June 14, 2024

Thank you for your answer !
Is the training code 'train_atlas_3dnaigsr.py' ?

from naisr.

jiaoyining avatar jiaoyining commented on June 14, 2024

Yes exactly. And the model is there naisr/model_naigsr.py

from naisr.

Related Issues (2)

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.