Skip to content

Understanding issues of custom layer- "ClusteringLayer" #3

@TanmoyDam

Description

@TanmoyDam

Thank you for sharing the code.
I am new in Keras. I know it is a stupid idea to ask this bellow question.
In ClusteringLayer, the encoder.output shpae is (?,10) which has been passed through the custom layer. When I pass the encoder.output weights to the custom layer "Bulid function", it generates weights for self.clustering by the size of(10,10) i.e the n_clusters is 10 and input_shape[1] is 10. Is it so? or I am missing something.
In "Call function", specifically in this line, q = 1.0 / (1.0 + (K.sum(K.square(K.expand_dims(inputs, axis=1) - self.clusters), axis=2) / self.alpha)), why do you use K.expand_dims? What is the purpose of using this?

Please help me to figure out these two problems.
Again thank you for sharing the beautiful code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions