fastaidocsprint / fastai

Documentation Sprint for the fastai deep learning library
http://fastaidocsprint.github.io/fastai
Apache License 2.0
15 stars 16 forks source link

18b_callback.preds: create docments #47

Open marii-moe opened 2 years ago

marii-moe commented 2 years ago

Add documents to 18b_callback.preds.

See the style guide and contribution guide for more details (links will be added when created).

This requires a beginner familiarity with fastai. This notebook defines a callback for predicting uncertainty.

Helpful Note: Think of dropout as adding randomness to the network, and seeing how much that randomness causes the results to move. We can get means and standard deviations and get an idea of how much our model's results vary. Have fun, this is a useful technique :)

Documents progress:

kurianbenoy commented 2 years ago

I would like to work on creating Document for MCDropoutcallback 🚀

marii-moe commented 2 years ago

@kurianbenoy assigned to you, go for it :)

Feel free to ping me with questions, or better yet ask on the discord.

kurianbenoy commented 2 years ago

I was taking a look at the callback MCDropoutCallback:

class MCDropoutCallback(Callback):
    def before_validate(self):
        for m in [m for m in flatten_model(self.model) if 'dropout' in m.__class__.__name__.lower()]:
            m.train()

    def after_validate(self):
        for m in [m for m in flatten_model(self.model) if 'dropout' in m.__class__.__name__.lower()]:
            m.eval()

The only arguments in this function are self, and it needn't be documented. So it looks to me none of functions needs to be documented in case of the MCDropoutCallback. While a few lines of comments may help to improve readability. What do you think @marii-moe ?

marii-moe commented 2 years ago

@kurianbenoy maybe add one-line a class level document, but yes, I think callbacks are something we haven't documented so much before. We can discuss your proposal during the code review, and I will get a few more opinions from other mentors.