In the part of lab 10 on 'Logistic regression in PyTorch' I am not quite sure how the class definition models a logistic regression?
I was trying to complete lab 10 but I don't have much experience with classes. What are the key elements to understand in the way the LogisticRegressionModel class is defined.
I am not sure what it means for a parameter to be passed as an argument in the class definition as such
'class LogisticRegressionModel(torch.nn.Module)'
Hi,
In the given class definition, 'torch.nn.Module' is not a parameter. Given syntax defines that class LogisticRegressionModel is child-class of torch.nn.Module. This means LogisticRegressionModels inherits all the functions and parameters of torch.nn.Module. You can read more about class inheritance in here: https://docs.python.org/3/tutorial/classes.html#inheritance
If you need more details, I think it would be easier to explain in person. For example, you can connect with your TA during the Thursday sessions.
Best,
Semih
logistic regression pytorch
Hi,
In the part of lab 10 on 'Logistic regression in PyTorch' I am not quite sure how the class definition models a logistic regression?
I was trying to complete lab 10 but I don't have much experience with classes. What are the key elements to understand in the way the LogisticRegressionModel class is defined.
I am not sure what it means for a parameter to be passed as an argument in the class definition as such
'class LogisticRegressionModel(torch.nn.Module)'
Thank you for your help
Hi,
In the given class definition, 'torch.nn.Module' is not a parameter. Given syntax defines that class LogisticRegressionModel is child-class of torch.nn.Module. This means LogisticRegressionModels inherits all the functions and parameters of torch.nn.Module. You can read more about class inheritance in here: https://docs.python.org/3/tutorial/classes.html#inheritance
If you need more details, I think it would be easier to explain in person. For example, you can connect with your TA during the Thursday sessions.
Best,
Semih
Hi,
Now the solutions for lab 10 are posted: https://github.com/epfml/ML_course/blob/master/labs/ex10/solution/ex10.ipynb.
And you are also very welcome to come today at 17:15 to the presentation of the solutions if something is still unclear.
Best,
Maksym
1
Add comment