OOP Task Trainer
See original GitHub issueRecently, ESPnet has a lot of duplicated lines in def train(args): ...
of ASR, ASR-MIX, LM, MT, TTS, ST, etc. It is hard to maintain and update because lots of complicated things (custom fp, data loader, transfer learning) are copy-and-pasted in the huge GOD functions. I wanna unify those duplicated parts. How about unifying these with extensible OOP-based design?
# task-dependent part
class TaskInterface:
@staticmethod
def add_arguments(parser):
def init_dataset(self, ...):
def init_model(self, ...):
def init_criterion(self, ...):
def init_sampler(self, ...):
# task-independent training loop
class TaskRunner:
def train(self, task: TaskInterface):
def eval(self, task: TaskInterface):
def run(self):
see also: https://github.com/pytorch/fairseq/blob/master/fairseq/tasks/fairseq_task.py
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Main principles of OOP - EPAM training center
Let's get introduced to the main principles of the object-oriented programming - one of the main programming methodologies, which is based ...
Read more >Object Oriented Programming: A Breakdown for Beginners
Object oriented programming (or OOP) is a collection of objects (data) ... All doctors must go through the same training, then they go...
Read more >Java Object Oriented Programming Cheat Sheet - Edureka
The course is designed to give you a head start into Java programming and train you for both core and advanced Java concepts...
Read more >Python OOP - Object Oriented Programming for Beginners
Learn Object Oriented Programming (OOP) in Python with mini projects, hands-on practice, and carefully designed visual explanations.
Read more >Object Oriented Programming with Python - YouTube
Object Oriented Programming is an important concept in software development. In this complete tutorial, you will learn all about OOP and how ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, I’m also afraid that copying fairseq is not enough for us. My goal is not just splitting task-dependent and task-independent parts because the task-dependent part still can be duplicated.
(I believe that TaskRunner is just a common part of existing Trainer and Evaluator in all the tasks)
However, this idea can make relationship between tasks explicitly (instead of randomly importing symbols). For example, ASR mix class can be derived from ASR. And ST class can be derived from ASR and MT.
2019年9月9日(月) 21:28 Tomoki Hayashi notifications@github.com:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.