Comments (3)
If we want to be explicit but at the same time be concise, we could take dataclasses as arguments, for example (from my project):
which is passed to the LightningModule
(HTREngineModule):
and then used to configure_optimizers
:
What do you think about that? The only disadvantage is having to create the dataclass. We could also allow passing a dict if users don't want to bother with it
from lightning-transformers.
Great suggestion, I think data classes can be extremely useful here! Let me hack something out on the PR branch and see how it plays out, Hydra has good integration with dataclasses which should make this nice.
from lightning-transformers.
So I gave it a shot (and probably spent more time than I should've :D) and turns out it isn't as simple as I thought :( from the dataclass perspective it's fine and I've put some example of how the dataclasses can look: https://github.com/PyTorchLightning/lightning-transformers/tree/draft/dataclasses
However it opens up a can of worms with Hydra. Hydras' interface for dataclasses is quite intrusive even in the minimal example. I've worked with this API before which worked fine for when we didn't expect the need for instantiation.
We would need to add the configs to the ConfigStore (which currently isn't many) but in my eyes looks a lot like boilerplate and could grow pretty large especially if a user wants to add their own. We should just be able to do everything we want via the conf files + adding our own dataset code. In addition, figuring how to instantiate an object + config took a lot of thought; more than a user of Hydra should need.
After weighing the positives/negatives it's best we stick with the proposed solution in #20, which is clear enough for the user to know what's happening.
I'll try get @tchaton's views on this as well on the Hydra side!
from lightning-transformers.
Related Issues (20)
- Running inference on GPU HOT 3
- DeepSpeed integration broken: Tensors must be CUDA and dense HOT 3
- Support for `pytorch_lightning.Trainer.predict` HOT 1
- Ignore padding tokens when using Translation Task + `padding='max_length'` HOT 6
- What do you guys think about having this in a method called set model? HOT 2
- Shuffle support HOT 2
- HFSaveCheckpoint does not work with deepspeed HOT 5
- LightningCLI compatibility and Type["AutoModel"] HOT 4
- TextClassificationTransformer should log torchmetrics object instead of computed Tensors HOT 1
- How to fix ModuleNotFoundError: No module named 'habana_frameworks.torch' HOT 1
- pip installation issues HOT 4
- Can you demonstrate how to fine-tune a pretrained model on unlabeled data HOT 6
- Deepspeed sharding and load from checkpoint with custom lightning module - setup() not called during checkpoint loading HOT 2
- Jointly train Question Answering and Multiple Choice HOT 1
- language model load from checkpoint error HOT 1
- Shuffling support
- `TransformerDataModule.setup()` run more than once unnecessarily
- Lightning 1.8 breaks lightning-transformers HOT 1
- Ver0.2.4 compatibility PL v1.8 HOT 6
- HF compatibility issue HOT 3
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 lightning-transformers.