scil-vital / dwi_ml

Code for people working on machine learning for diffusion MRI
MIT License
8 stars 7 forks source link

AE forward function #247

Open arnaudbore opened 3 weeks ago

arnaudbore commented 3 weeks ago

We have a small problem of "good python" here, because in the super model class (MainModelAbstract), the forward method is:

def forward(self, inputs, streamlines): raise NotImplementedError So your child class does not fit with the super. It will still run because your forward superseeds the parent's class's forward. But it's not "nice python", it creates warning in the editor. We could simply delete the two lines here:

https://github.com/scil-vital/dwi_ml/blob/3ebc194fbf3de62c22e266aef4ebc10ab97144b9/dwi_ml/models/main_models.py#L210C5-L211C34

But then in the trainer, it might complain that the 'forward' does not exist.

The other method is to manage with *args, **kwargs.

Please add an issue with this, I will manage one day, it's ok for now.

220