Skip to content

gp_kernel_scale_trainable=True in RandomFeatureGaussianProcess does not work #419

@yezhengli-Mr9

Description

@yezhengli-Mr9

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions