Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_config function #212

Open
jyan26 opened this issue Dec 14, 2020 · 2 comments
Open

get_config function #212

jyan26 opened this issue Dec 14, 2020 · 2 comments

Comments

@jyan26
Copy link

jyan26 commented Dec 14, 2020

In t3f nn.py, I was wondering if we could add get_config function to KerasDense class so that we could save the trained model? Right now, without get_config, I got this error message when trying to save the model or using callbacks in model.fit: "NotImplementedError: Layers with arguments in __init__ must override get_config." (I'm using TF 2.0.3.) So maybe we could add something like (I'm not sure if the following is right):

def get_config(self):
  config = super(KerasDense,self).get_config()
  config.update({'input_dims': self.input_dims,
                 'output_dims': self.output_dims,
                 'tt_rank': self.tt_rank,
                 'activation': self.activation,
                 'use_bias': self.use_bias,
                 'kernel_initializer':self.kernel_initializer,
                 'bias_initializer': self.bias_initializer})
  return config
@Bihaqo
Copy link
Owner

Bihaqo commented Dec 27, 2020 via email

@jyan26
Copy link
Author

jyan26 commented Dec 30, 2020

Yes, sure, please feel free to copy and paste this code. I didn't have a chance to test this code though, so please test it along with other codes before adding it into the library. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants