Comments (4)
Lines 119 to 122 in 9ba80c7
The network has two outputs which are feat
and out
, note that feat
and out
have the same shape. The process is as follows:
- Get pseudo labels by using
argmax
inout
. - For each class, select corresponding
feat
in pixel-level by pseudo labels, and then perfomeF.adaptive_avg_pool2d
in selectedfeat
to get image-level features of each class.
from proda.
2\. For each class, select corresponding `feat` in pixel-level by pseudo labels, and then perfome `F.adaptive_avg_pool2d` in selected `feat` to get image-level features of each class.
Why is it needed to perform adaptive average pooling? To my understanding, if I were to plot features I would do the following:
- Get pseudo labels by using
argmax
inout
. The resulting tensorout_argmax
has a shape of[batch_size, h, w]
, which I flatten out into a unidimensional vector calledclass_ids
of size[N]
, whereN=batch_size*h*w.
- Reshape the features
feat
to match the vector ofclass_ids
: from a feature tensor of shape[batch_size, depth, h, w]
to a new shape[N, depth]
. Let's call the resulting reshaped tensorfeats_r
. - Store
class_ids
from 1) andfeats_r
from 2) into a pandas dataframe. All the class ids and reshaped features are accumulated into a pandas dataframedf
withdepth + 1
columns, where the firstdepth
columns are for the features and the last one for the class ids. - Use UMAP to reduce all but the last column of
df
, and plot the resulting embeddings using the class ids for the corresponding color of each point.
from proda.
Lines 119 to 122 in 9ba80c7
The network has two outputs which are
feat
andout
, note thatfeat
andout
have the same shape. The process is as follows:1. Get pseudo labels by using `argmax` in `out`. 2. For each class, select corresponding `feat` in pixel-level by pseudo labels, and then perfome `F.adaptive_avg_pool2d` in selected `feat` to get image-level features of each class.
I just tried this approach, storing all these vectors s
in a dataframe, and then reducing this dataframe to 2D representations using UMAP, but I obtained very dense clusters compared to the figures in the manuscript, where the point clouds look more sparse. Could you please provide more information about these feature representations:
- Are these features computed on the training split of Cityscapes?
- What parameters are used for UMAP (n_neighbors, etc.)?
- Are these feature vectors computed per batch or per image?
Would be glad to hear from you. Thanks!
from proda.
no reply, right?
from proda.
Related Issues (20)
- Discriminator model
- Missing key(s) when loading the pre-trained simclr model parameters in stage 3 HOT 7
- Training Stage Loss HOT 2
- pretrained/simclr/r101_1x_sk0.pth
- two GPUs HOT 1
- About the function full2weak() and label_strong_T() HOT 5
- source-only pretrained model
- Exact command line of warmup stage HOT 3
- The kl_div loss of self distillation HOT 1
- About the flip Image HOT 1
- About the mIoU metric HOT 1
- Good job! Some questions about the file calc_prototype.py, thanks!
- the training in Synthia - > cityscapes warmup
- Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! HOT 1
- Potential Bug issue
- Which pictures of Cityscapes dataset are use to make _qualitative results of semantic segmentation_? HOT 1
- UMAP visualization
- calc_prototype.py HOT 1
- about settings
- How can I experiment with ProDA for 13classes?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proda.