Reinforcement Learning
Transformers
Safetensors
fga_navigation
visual-navigation
factor-graph-attention
Instructions to use Idan/fga-navigation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Idan/fga-navigation with Transformers:
# Load model directly from transformers import NavigationPolicy model = NavigationPolicy.from_pretrained("Idan/fga-navigation", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 3,556 Bytes
4747bf9 576a80f 4747bf9 576a80f 4747bf9 576a80f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | ---
license: mit
tags:
- visual-navigation
- reinforcement-learning
- factor-graph-attention
library_name: transformers
---
# Target-driven visual navigation on factor graph attention
An agent is told an object to find and acts from egocentric observations in
AI2-THOR. Each grid cell of the observation is scored against the target's word
embedding, the recurrent memory and the last action, by the attention layer of
[Factor Graph Attention](https://arxiv.org/abs/1904.05880) (CVPR 2019). The
attention-weighted map -- not a pooled vector -- enters the recurrence, because
the agent has to know *where* the target is, not only that it is present.
Trained by advantage actor-critic on the SAVN offline dump: every reachable pose
was rendered once and its ResNet18 feature map cached, so no simulator is needed.
Code: [github.com/idansc/fga](https://github.com/idansc/fga).
## Results
Scored on the **published fixed set of 3,914 test episodes**, each pinning the
scene, the target object instance and the start pose. Checkpoints were selected on
the 4,086 val episodes and the winner scored once on test, which is what the
original's `full_eval.py` does.
| | success | SPL |
| --- | --- | --- |
| **this checkpoint** | **0.421** | **0.167** |
| released A2C weights, same protocol | 0.405 | 0.167 |
| released final weights, same protocol | 0.411 | 0.163 |
| published figure | 0.462 | 0.179 |
The released weights were re-scored here rather than taken on trust, and they land
in the same range: the roughly four-point offset to the published 0.462 applies to
them as much as to this model, so it belongs to the measurement rather than to the
training. Their model's SPL reproduces to 0.003, which is what says the
environment is faithful.
Two things worth knowing if you build on this. Val and test disagree — the run
that scored 0.367 on val scored 0.421 on test — so val selection is not a reliable
proxy here even though it is the published protocol. And the agents overfit to
training scenes: train success reaches 0.906 while held-out sits near 0.42, and
more episodes past about one million make that worse rather than better.
## Usage
```python
from fga.tasks.navigation import NavigationPolicy
policy = NavigationPolicy.from_pretrained("Idan/fga-navigation")
out = policy(target_embeds=glove, observation=resnet_grid, hidden_state=state)
action = out.action_logits.argmax(-1)
```
The episodes come from the SAVN offline data:
```bash
curl -O https://prior-datasets.s3.us-east-2.amazonaws.com/savn/data.tar.gz
python scripts/run_navigation.py --data_root data \
--val_episodes data/val_episodes.json --test_episodes data/test_episodes.json \
--output_dir models/navigation
```
## Citation
Please cite both the attention and the navigation work:
```bibtex
@inproceedings{schwartz2019factor,
title={Factor graph attention},
author={Schwartz, Idan and Yu, Seunghak and Hazan, Tamir and Schwing, Alexander G},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={2039--2048},
year={2019}
}
@inproceedings{mayo2021visual,
title={Visual Navigation with Spatial Attention},
author={Mayo, Bar and Hazan, Tamir and Tal, Ayellet},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2021}
}
```
The navigation setting, the offline AI2-THOR data and the episode splits are from
[barmayo/spatial_attention](https://github.com/barmayo/spatial_attention)
([arXiv:2104.09807](https://arxiv.org/abs/2104.09807)).
|