gdbp/gdbp_base.py
def model_init(data: gdat.Input,
               base_conf: dict,
               sparams_flatkeys: list,
               n_symbols: int = 4000,
               sps : int = 2,
               name='Model'):
    ''' initialize model from base template, generating CDC, DBP, EDBP, FDBP, GDBP
    depending on given N-filter length and trainable parameters

    Args:
        data:
        base_conf: a dict of kwargs to make base module, see `make_base_module`
        sparams_flatkeys: a list of keys contains the static(nontrainable) parameters.
            For example, assume base module has parameters represented as nested dict
            {'color': 'red', 'size': {'width': 1, 'height': 2}}, its flatten layout is dict
             {('color',): 'red', ('size', 'width',): 1, ('size', 'height'): 2}, a sparams_flatkeys
             of [('color',): ('size', 'width',)] means 'color' and 'size/width' parameters are static.
            regexp key is supportted.
        n_symbols: number of symbols used to initialize model, use the minimal value greater than channel
            memory
        sps: sample per symbol. Only integer sps is supported now.

    Returns:
        a initialized model wrapped by a namedtuple
    '''
    
    mod = make_base_module(**base_conf, w0=data.w0)
    y0 = data.y[:n_symbols * sps]
    rng0 = random.PRNGKey(0)
    z0, v0 = mod.init(rng0, core.Signal(y0))
    ol = z0.t.start - z0.t.stop
    sparams, params = util.dict_split(v0['params'], sparams_flatkeys)
    state = v0['af_state']
    aux = v0['aux_inputs']
    const = v0['const']
    return Model(mod, (params, state, aux, const, sparams), ol, name)
 initialize model from base template, generating CDC, DBP, EDBP, FDBP, GDBP
    depending on given N-filter length and trainable parameters

    Args:
        data:
        base_conf: a dict of kwargs to make base module, see `make_base_module`
        sparams_flatkeys: a list of keys contains the static(nontrainable) parameters.
            For example, assume base module has parameters represented as nested dict
            {'color': 'red', 'size': {'width': 1, 'height': 2}}, its flatten layout is dict
             {('color',): 'red', ('size', 'width',): 1, ('size', 'height'): 2}, a sparams_flatkeys
             of [('color',): ('size', 'width',)] means 'color' and 'size/width' parameters are static.
            regexp key is supportted.
        n_symbols: number of symbols used to initialize model, use the minimal value greater than channel
            memory
        sps: sample per symbol. Only integer sps is supported now.

    Returns:
        a initialized model wrapped by a namedtuple
    
initialize model from base template, generating CDC, DBP, EDBP, FDBP, GDBP
depending on given N-filter length and trainable parameters
initialize model from base template generating CDC DBP EDBP FDBP GDBP depending on given N - filter length and trainable parameters
def model_init(data: gdat.Input,
               base_conf: dict,
               sparams_flatkeys: list,
               n_symbols: int = 4000,
               sps : int = 2,
               name='Model'):
    mod = make_base_module(**base_conf, w0=data.w0)
    y0 = data.y[:n_symbols * sps]
    rng0 = random.PRNGKey(0)
    z0, v0 = mod.init(rng0, core.Signal(y0))
    ol = z0.t.start - z0.t.stop
    sparams, params = util.dict_split(v0['params'], sparams_flatkeys)
    state = v0['af_state']
    aux = v0['aux_inputs']
    const = v0['const']
    return Model(mod, (params, state, aux, const, sparams), ol, name)
def model_init ( data : gdat . Input , base_conf : dict , sparams_flatkeys : list , n_symbols : int = 4000 , sps : int = 2 , name = 'Model' ) : mod = make_base_module ( ** base_conf , w0 = data . w0 ) y0 = data . y [ : n_symbols * sps ] rng0 = random . PRNGKey ( 0 ) z0 , v0 = mod . init ( rng0 , core . Signal ( y0 ) ) ol = z0 . t . start - z0 . t . stop sparams , params = util . dict_split ( v0 [ 'params' ] , sparams_flatkeys ) state = v0 [ 'af_state' ] aux = v0 [ 'aux_inputs' ] const = v0 [ 'const' ] return Model ( mod , ( params , state , aux , const , sparams ) , ol , name )
initialize model from base template, generating CDC, DBP, EDBP, FDBP, GDBP
depending on given N-filter length and trainable parameters
initialize model from base template generating CDC DBP EDBP FDBP GDBP depending on given N - filter length and trainable parameters
''' initialize model from base template, generating CDC, DBP, EDBP, FDBP, GDBP
    depending on given N-filter length and trainable parameters

    Args:
        data:
        base_conf: a dict of kwargs to make base module, see `make_base_module`
        sparams_flatkeys: a list of keys contains the static(nontrainable) parameters.
            For example, assume base module has parameters represented as nested dict
            {'color': 'red', 'size': {'width': 1, 'height': 2}}, its flatten layout is dict
             {('color',): 'red', ('size', 'width',): 1, ('size', 'height'): 2}, a sparams_flatkeys
             of [('color',): ('size', 'width',)] means 'color' and 'size/width' parameters are static.
            regexp key is supportted.
        n_symbols: number of symbols used to initialize model, use the minimal value greater than channel
            memory
        sps: sample per symbol. Only integer sps is supported now.

    Returns:
        a initialized model wrapped by a namedtuple
    '''
a initialized model wrapped by a namedtuple
a initialized model wrapped by a namedtuple
data
gdat.Input
None
base_conf
dict
a dict of kwargs to make base module, see `make_base_module`
a dict of kwargs to make base module see ` make_base_module `
sparams_flatkeys
list
a list of keys contains the static(nontrainable) parameters.
For example, assume base module has parameters represented as nested dict
{'color': 'red', 'size': {'width': 1, 'height': 2}}, its flatten layout is dict
{('color',): 'red', ('size', 'width',): 1, ('size', 'height'): 2}, a sparams_flatkeys
of [('color',): ('size', 'width',)] means 'color' and 'size/width' parameters are static.
regexp key is supportted.
a list of keys contains the static ( nontrainable ) parameters . For example assume base module has parameters represented as nested dict { ' color ' : ' red ' ' size ' : { ' width ' : 1 ' height ' : 2 }} its flatten layout is dict { ( ' color ' ) : ' red ' ( ' size ' ' width ' ) : 1 ( ' size ' ' height ' ) : 2 } a sparams_flatkeys of [ ( ' color ' ) : ( ' size ' ' width ' ) ] means ' color ' and ' size / width ' parameters are static . regexp key is supportted .
n_symbols
int
number of symbols used to initialize model, use the minimal value greater than channel
memory
number of symbols used to initialize model use the minimal value greater than channel memory
sps
int
sample per symbol. Only integer sps is supported now.
sample per symbol . Only integer sps is supported now .
name