[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)
# MultiModalCrossAttn
The open source implementation of the cross attention mechanism from the paper: "JOINTLY TRAINING LARGE AUTOREGRESSIVE MULTIMODAL MODELS"
[Paper Link](https://arxiv.org/pdf/2309.15564.pdf)
# Appreciation
* Lucidrains
* Agorians
# Install
`pip install cross-attn`
# Usage
```python
import torch
from cross_attn.main import MultiModalCrossAttention
# Test the MultiModalCrossAttention module
dim = 512 # For example
num_heads = 8
cross_attn = MultiModalCrossAttention(dim, num_heads)
Hllm_sample = torch.randn(32, dim, dim) # Batch size = 32, Sequence length = 10
Himg_sample = torch.randn(32, dim, dim)
output = cross_attn(Hllm_sample, Himg_sample)
print(output)
print(output.shape) # Expected: [32, 10, 512]
```
# License
MIT
# Citations
```
@misc{2309.15564,
Author = {Emanuele Aiello and Lili Yu and Yixin Nie and Armen Aghajanyan and Barlas Oguz},
Title = {Jointly Training Large Autoregressive Multimodal Models},
Year = {2023},
Eprint = {arXiv:2309.15564},
}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/kyegomez/MultiModalCrossAttn",
"name": "cross-attn",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6,<4.0",
"maintainer_email": "",
"keywords": "artificial intelligence,deep learning,optimizers,Prompt Engineering",
"author": "Kye Gomez",
"author_email": "kye@apac.ai",
"download_url": "https://files.pythonhosted.org/packages/d7/f9/d92e469e7823a3b18d7141cbdf1955d19ba9871ce11913e49cf7c83a9c40/cross_attn-0.0.4.tar.gz",
"platform": null,
"description": "[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)\n\n# MultiModalCrossAttn\nThe open source implementation of the cross attention mechanism from the paper: \"JOINTLY TRAINING LARGE AUTOREGRESSIVE MULTIMODAL MODELS\"\n\n\n[Paper Link](https://arxiv.org/pdf/2309.15564.pdf)\n\n# Appreciation\n* Lucidrains\n* Agorians\n\n\n\n# Install\n`pip install cross-attn`\n\n# Usage\n```python\nimport torch\nfrom cross_attn.main import MultiModalCrossAttention\n\n# Test the MultiModalCrossAttention module\ndim = 512 # For example\nnum_heads = 8\n\ncross_attn = MultiModalCrossAttention(dim, num_heads)\n\nHllm_sample = torch.randn(32, dim, dim) # Batch size = 32, Sequence length = 10\nHimg_sample = torch.randn(32, dim, dim)\n\noutput = cross_attn(Hllm_sample, Himg_sample)\nprint(output)\n\nprint(output.shape) # Expected: [32, 10, 512]\n\n```\n\n\n\n# License\nMIT\n\n# Citations\n```\n@misc{2309.15564,\nAuthor = {Emanuele Aiello and Lili Yu and Yixin Nie and Armen Aghajanyan and Barlas Oguz},\nTitle = {Jointly Training Large Autoregressive Multimodal Models},\nYear = {2023},\nEprint = {arXiv:2309.15564},\n}\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "MultiModalCrossAttn - Pytorch",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/kyegomez/MultiModalCrossAttn",
"Repository": "https://github.com/kyegomez/MultiModalCrossAttn"
},
"split_keywords": [
"artificial intelligence",
"deep learning",
"optimizers",
"prompt engineering"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a289a691e68e84925f667d488d3b30275d820e1d81bfcb65bd05502edfed60ec",
"md5": "dd4f1a3f041799e055a6cf76d1bacb61",
"sha256": "6bddc93cf977f0b6dff95db5c54b34f57e9fbee959f6525e73a2b9644b84e78e"
},
"downloads": -1,
"filename": "cross_attn-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dd4f1a3f041799e055a6cf76d1bacb61",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6,<4.0",
"size": 12135,
"upload_time": "2023-10-03T06:03:35",
"upload_time_iso_8601": "2023-10-03T06:03:35.612149Z",
"url": "https://files.pythonhosted.org/packages/a2/89/a691e68e84925f667d488d3b30275d820e1d81bfcb65bd05502edfed60ec/cross_attn-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d7f9d92e469e7823a3b18d7141cbdf1955d19ba9871ce11913e49cf7c83a9c40",
"md5": "b766a1a951bdcb3be47949d518f56330",
"sha256": "3963356be89244942a5e8972fc9adfe16c86385b766d74df4331d0d34dcea5b7"
},
"downloads": -1,
"filename": "cross_attn-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "b766a1a951bdcb3be47949d518f56330",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6,<4.0",
"size": 8950,
"upload_time": "2023-10-03T06:03:37",
"upload_time_iso_8601": "2023-10-03T06:03:37.209092Z",
"url": "https://files.pythonhosted.org/packages/d7/f9/d92e469e7823a3b18d7141cbdf1955d19ba9871ce11913e49cf7c83a9c40/cross_attn-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-03 06:03:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kyegomez",
"github_project": "MultiModalCrossAttn",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "cross-attn"
}