示例#1
0
def _get_primitive_instance(primitive, kwargs):
    expected_args = load_primitive(primitive).get('hyperparameters',
                                                  {}).get('fixed', {})
    given_args = {
        key: value
        for key, value in kwargs.items() if key in expected_args
    }

    return MLBlock(primitive, **given_args)
示例#2
0
def load_primitive(primitive, arguments=None):
    arguments = arguments or dict()

    return MLBlock(primitive, **arguments)