Skip to content
Discussion options

You must be logged in to vote

First of all: I'm glad you are enjoying lightning :)

Coming to your code: It actually doesn't look so bad to me. You're separating functionality for different use cases in different functions (which is perfectly fine). What you could do ( if you really want to) is something like this:

class BaseModel(LightningModule):
   ... # implements all the logic to be shared between the models such as the module logic or something like this

class SegmentationModel(BaseModel):
    ... # adds all the segmentation-only logic

class DepthModel(BaseModel):
    ... # adds all the depth-only logic

class CombinedModel(LightningModel):
    def __init__(self, model, hparams):
        if depth:
            m…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@teufelweich
Comment options

@justusschock
Comment options

@teufelweich
Comment options

@justusschock
Comment options

@teufelweich
Comment options

Answer selected by teufelweich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment