GAIN
Pytorch implementation of paper: [Tell Me Where to Look: Guided Attention Inference Network](http://openaccess.thecvf.com/content_cvpr_2018/papers/Li_Tell_Me_Where_CVPR_2018_paper.pdf)
Install / Use
/learn @ngxbac/GAINREADME
GAIN Framework
GAIN framework allows model to focus on a specific areas of object by changing the attention maps (Grad-CAM).
The flow of the framework is summarized as follow:
- First, we should register the
feed-forwardandbackwardof the last convolution layer (or block). - Model generates the attention maps (Grad-CAM) from
forward featuresand backwardfeaturesthen normalize it by using threshold andsigmoidfunction. - Now, the attention maps covers almost important information of the object. We want to tell the model those kind of areas
are important for the task. It can be done by applying attention maps into the original image.
Let imagine that the
masked_imagenow is containing useless information. When we feedmasked_imageinto the model again, we expect that the prediction score is as low as possible. That is the idea ofattention miningin the paper. - The losses are computed at GAINCriterionCallback
In this implementation, I select resnet50 as the base-model to perform GAIN framework. You can change the backbone and it's gradient layer as you want.
Train GAIN
bash bin/train_gain.sh
Related Skills
qqbot-channel
344.1kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
99.8k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
344.1kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Design
Campus Second-Hand Trading Platform \- General Design Document (v5.0 \- React Architecture \- Complete Final Version)1\. System Overall Design 1.1. Project Overview This project aims t
