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

Heatmap #12

Closed
chen-ya-ling opened this issue Nov 6, 2020 · 3 comments
Closed

Heatmap #12

chen-ya-ling opened this issue Nov 6, 2020 · 3 comments

Comments

@chen-ya-ling
Copy link

Hello, how can I see the generated heatmap? I set --heapmap to true, but I don't see the generated heatmap.

@FlorentF9
Copy link
Owner

Hi, you can output the heatmap using the predict_heatmapmethod of the DTC class, defined here: https://github.com/FlorentF9/DeepTemporalClustering/blob/master/DeepTemporalClustering.py#L277

You have to build the model and train it (or load weights) in a script beforehand. However I warn you that I did not manage to get satisfying results (the paper does not provided much details on the implementation and training of the heatmap network). Tell me if you achieve something 😃

@BEbillionaireUSD
Copy link

Hi,
Could you please explain more about that? From the predict_map I can get an array with shape (samples, times, clusters), right?

How can I generate a heatmap? Which vector can be used to plot? For a heatmap, I need a n*n matrix.

@FlorentF9
Copy link
Owner

The heatmap is what is called an "activation map" or "saliency map", often used in computer vision. It indicates how much each dimension of the input - here the dimension is time - contributes to each class or cluster.
Basically, the heatmap network is a classifier, where element (i, t, c) of the heatmap represents how much time t of input i contributes to being classified in cluster c. The values are activations of a convolution layer, so these are not probabilities. Probabilities are obtained later, after applying a GAP (global average pooling) on time dimension + a softmax normalization.

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

3 participants