-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CIFAR CNNTransformer example to Lightning #356
Conversation
using pytorch-lightning
# Conflicts: # examples/cifar_cnntransformer/config.py # kale/pipeline/base_nn_trainer.py
Haolin has finished the changes, and we are waiting for passing the tests due to the issue #371. |
The line length recommended by PEP 8 style guide is 79 for Python code and 72 for docstring or comment. It comes from historical constraints of early computer terminals and displays that were limited to 80 columns. 72 characters are allowed for some indentation and whitespace. Google coding style limits it to 80. In this example, the original codes made by Raivo follow this style, so many line breaks are used. PyKale sets 120 for code but nothing compulsory for docstring or comment. With the much more generous limits of modern displays and tools, It would be fine for academic research. The only inconvenience I have met is that when opening several files side by side in the PyCharm default setting, I need to scroll horizontally if a file line is over 88 characters. For industry applications, it would be influenced by the real-world display and equipment. |
<div align="center"> | ||
<img src="CIFAR10-ModelComparison-ValAcc-Lightning.png" alt="Editor" width="80%"> | ||
</div> | ||
(The code example in this folder is not intended to achieve any state-of-art result, but rather to demonstrate the use of CNNTransformer.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HaolinWang2001
- This is quite verbose. Just say "This example is not inteneded" rather than "The code example in this folder is not indended".
- I said "state-of-the-art" but you put "state-of-art", have you checked your changes against my suggestion? Why are you removing "the"? Have you Googled to learn or asked Xianyuan or ChatGPT if you are not sure? This is unacceptable and unnecessarily delaying the progress. Please double check unitil you can provide high-quality input consistently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes have been made. I have double-checked that "state-of-art" is a typo, which has been corrected. Thank you for bringing this to my attention, I will take extra care to ensure that such errors do not occur again in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HaolinWang2001 Further minor changes are needed before merging. See comments above please.
# Conflicts: # examples/cifar_cnntransformer/README.md
Description
Convert the CIFAR CNNTransformer example from PyTorch to PyTorch Lightning.
Change summary:
cifar_cnntransformer/main.py
to trainer that uses Lightning.PredictionHead
incifar_cnntransformer/model.py
tokale.predict.class_domain_nets
and renamed it toClassNet
.SimpleCNN
incifar_cnntransformer/model.py
tokale.embed.image_cnn
.BaseTrainer
andCNNTransformerTrainer
inkale.pipeline.base_trainer
.Status
Ready
Types of changes
docs
manually updated for new API.