IDA-HumanCapital/fife

construct_embedding_network in tf_modelers.py

Opened this issue · 0 comments

In both TFModeler.build_model() and TFModeler.hyperoptimize(), use of construct_embedding_network() attempts to take arguments passed in params, but the expression used to identify these parameters doesn't actually work because it doesn't successfully convert the params to lower case. Here's an example inside TFModeler.build_model():

self.model = self.construct_embedding_network(
    **{k.lower(): v for k, v in params.items() if k in construction_args}
)

This expression correctly makes the dict keys lower case, but does not convert the params keys to lower case when searching for them in construction_args, leading to no custom params actually being used in construct_embedding_network(), such as DROPOUT_SHARE and DENSE_LAYERS.

Simply making this modification should fix this for the places where this occurs:

self.model = self.construct_embedding_network(
    **{k.lower(): v for k, v in params.items() if k.lower() in construction_args}
)