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

gp_kernel_scale_trainable=True in RandomFeatureGaussianProcess does not work #419

Open
yezhengli-Mr9 opened this issue Sep 29, 2020 · 0 comments

Comments

@yezhengli-Mr9
Copy link

yezhengli-Mr9 commented Sep 29, 2020

Setting gp_kernel_scale_trainable=True in class RandomFeatureGaussianProcess( does not work. Anyway, we might have hidden layers for raw inputs/features.

I also try to modify:

self.unscaled_kernel = self.add_weight(
        name='unscaled_kernel',
        shape=(input_dim, self.output_dim),
        dtype=dtypes.float32,
        initializer=kernel_initializer,
++        trainable=True)

and pay attention to

      self.scale = _get_default_scale(self.kernel_initializer, input_dim)
    self.kernel_scale = self.add_weight(
        name='kernel_scale',
        shape=(1,),
        dtype=dtypes.float32,
        initializer=init_ops.constant_initializer(self.scale),
        trainable=True,
        constraint='NonNeg')

in tf.keras.layers.experimental.RandomFourierFeatures (the file is kernelized.py)

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

1 participant