How to use the chemprop.nn_utils.MAMLLinear function in chemprop

To help you get started, we’ve selected a few chemprop examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wengong-jin / chemprop / chemprop / models / model.py View on Github external
def linear_layer(input_dim: int, output_dim: int, p: float, idx: int):
                if params is not None:
                    return MAMLLinear(
                                   weight=params[f'ffn.{idx}.weight'],
                                   bias=params[f'ffn.{idx}.bias'])
                return nn.Linear(input_dim, output_dim)
github wengong-jin / chemprop / chemprop / nn_utils.py View on Github external
def __init__(self, weight, bias):
        super(MAMLLinear, self).__init__()
        self.weight = nn.Parameter(weight)
        self.bias = nn.Parameter(bias)