{"id":32370235,"url":"https://github.com/g0lemxiv/lambdanetworks","last_synced_at":"2025-10-24T20:24:57.177Z","repository":{"id":62575044,"uuid":"305274959","full_name":"g0lemXIV/LambdaNetworks","owner":"g0lemXIV","description":"Implementation of LambdaNetworks, a framework for capturing long-range interaction between structured contextual information. Tensorflow-2.x implementation.","archived":false,"fork":false,"pushed_at":"2020-11-23T15:21:04.000Z","size":25,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T03:27:35.067Z","etag":null,"topics":["artificial-intelligence","attention","deep-learning","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/g0lemXIV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-19T05:43:59.000Z","updated_at":"2024-04-06T20:12:44.000Z","dependencies_parsed_at":"2022-11-03T20:44:29.549Z","dependency_job_id":null,"html_url":"https://github.com/g0lemXIV/LambdaNetworks","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/g0lemXIV/LambdaNetworks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g0lemXIV%2FLambdaNetworks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g0lemXIV%2FLambdaNetworks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g0lemXIV%2FLambdaNetworks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g0lemXIV%2FLambdaNetworks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g0lemXIV","download_url":"https://codeload.github.com/g0lemXIV/LambdaNetworks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g0lemXIV%2FLambdaNetworks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280859879,"owners_count":26403634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","attention","deep-learning","tensorflow"],"created_at":"2025-10-24T20:24:51.688Z","updated_at":"2025-10-24T20:24:57.171Z","avatar_url":"https://github.com/g0lemXIV.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LambdaNetworks\n![Python tests](https://github.com/g0lemXIV/LambdaNetworks/workflows/Python%20tests/badge.svg?branch=main) ![License](https://img.shields.io/pypi/l/ansicolortags.svg)\n\nTensorflow implementation of [Lambda Network](https://openreview.net/forum?id=xTJEN-ggl1b) framework for capturing long-range interaction between input and structured information.\n\nPaper review: [Yannic Kilcher's channel](https://www.youtube.com/watch?v=3qxJ2WD8p4w)\nPytorch implementation (I was based on): [lucidrains](https://github.com/lucidrains/lambda-networks)  \n\n*However, I will implement 1D convolution lambda and lambda dense here, soon...*\n\n## Installation  \n```bash\ngit clone \u003crepository\u003e\ncd LambdaNetworks\npip install .\n```\n\n## Examples of usage\n\n**Using Lambda 2D**\n```python\nfrom lambda_layers import LambdaNetwork2DConv\n\nlayer = LambdaNetwork2DConv(kernel_out = 32,  # output of the layer\n                            key_depth = 16, # depth of keys\n                            intra_depth = 1, depth of \n                            heads = 4, # number of heads\n                            size = 28 * 28, # total size of the input image (use for global embedding)\n                            receptive_kernel = 7, # dimension of kernel if local embedding is using\n                            data_format = \"channels_last\", # data format\n                            norm_keys = False, # normalization of the key before activation function\n                            **kwargs # additional args which can use in queries, keys, and values\n                            )\n```\n**Using Lambda 1D/Dense**\n```python\nfrom lambda_layers import LambdaNetwork1DConv, LambdaNetwork1Dense\n\nlayer = LambdaNetwork1DConv(kernel_out = 32,  # output of the layer\n                            key_depth = 16, # depth of keys\n                            intra_depth = 1, # infra-depth of the layer\n                            heads = 4, # number of heads\n                            size = 28, # total number of timesteps\n                            receptive_kernel = 7, # dimension of kernel if local embedding is using\n                            data_format = \"channels_last\", # data format\n                            norm_keys = False, # normalization of the key before activation function\n                            **kwargs # additional args which can use in queries, keys, and values\n                            )\n                            \nlayer = LambdaNetwork1Dense(kernel_out = 32,  # output of the layer\n                            key_depth = 16, # depth of keys\n                            intra_depth = 1, # infra-depth of the layer\n                            heads = 4, # number of heads\n                            size = 28, # total number of timesteps\n                            receptive_kernel = 7, # dimension of kernel if local embedding is using\n                            data_format = \"channels_last\", # data format\n                            norm_keys = False, # normalization of the key before activation function\n                            **kwargs # additional args which can use in queries, keys, and values\n                            )\n```\n\n## Citations\n\n```\n@inproceedings{\n    anonymous2021lambdanetworks,\n    title={LambdaNetworks: Modeling long-range Interactions without Attention},\n    author={Anonymous},\n    booktitle={Submitted to International Conference on Learning Representations},\n    year={2021},\n    url={https://openreview.net/forum?id=xTJEN-ggl1b},\n    note={under review}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg0lemxiv%2Flambdanetworks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg0lemxiv%2Flambdanetworks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg0lemxiv%2Flambdanetworks/lists"}