Comments (3)
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.
Thank you for your answer !
Is the training code 'train_atlas_3dnaigsr.py' ?
from naisr.
Yes exactly. And the model is there naisr/model_naigsr.py
from naisr.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from naisr.