Skip to content

[Task] Create a diff wofost72_pp module with one nn.module #98

@SarahAlidoost

Description

@SarahAlidoost

As an example, we want to show if the partitioning module can be replaced with an nn.module, e.g. partitioning_states = partitioning_nn(dvs).

Requirements:

import torch.nn as nn

class PartitioningNN(nn.Module):
    def __init__(self, ...):
        ...

    def forward(self, dvs):
        return partition_states/rates


class HybridModel(nn.Module):
    def __init__(self, physical_params):
        super().__init__()
        self.partitioning_nn = PartitioningNN(input_size=3)
        # pass self.partitioning_nn to wofost via config or another implementation
        wofost72_config = Configuration(
            CROP=Wofost72,
            SOIL=WaterbalancePP,
            ML=self.partitioning_nn,  # this can be more generic later
            OUTPUT_VARS=...,
        )
        self.engine = Engine(..., config=wofost72_config)
        self.physical_params = nn.ParameterDict(...)

    def forward(self, ...):
        model = self.engine.setup(...)
        model.run_till_terminate()
        results = model.get_output()
    return results

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

To Do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions