FrancescoSaverioZuppichini / detector

14 stars 0 forks source link

Lazying coupling modelling code and training code #6

Closed FrancescoSaverioZuppichini closed 1 year ago

FrancescoSaverioZuppichini commented 1 year ago

Motivation

Currently, the model (YOTO) is not coupled (aka coded inside a LightningModule). Since I am lazy, I think it would be faster to just change the folder tasks to modelling and add a YOTOForObjectDetection directly inside a LightningModule

Today is not the day to think too much about design!

FrancescoSaverioZuppichini commented 1 year ago

Edit 1: Having everything inside a LightningModule will force me to pass all the parameters to create the model itself, making it impossible to swap around components layer on!

FrancescoSaverioZuppichini commented 1 year ago

Edit 2: I could pass the loss ass well to the LightningModule

class YOTOForObjectDetectionTask(pl.LightningModule):
    def __init__(self, model, loss):

This will make the task model independent, but I guess it will require the model and loss to work properly together - aka trusting each others outputs.

Current idea now is just to have the model and the task, in the task we pass the model and the loss and hopefully at one time it will be model independent but only task dependent - aka model will have to return something that can be just passed to a loss function