{"id":15642865,"url":"https://github.com/zimmerrol/keras-utility-layer-collection","last_synced_at":"2025-04-30T11:15:51.225Z","repository":{"id":62574812,"uuid":"136825033","full_name":"zimmerrol/keras-utility-layer-collection","owner":"zimmerrol","description":"Collection of custom layers and utility functions for Keras which are missing in the main framework.","archived":false,"fork":false,"pushed_at":"2020-05-25T13:15:29.000Z","size":44,"stargazers_count":62,"open_issues_count":2,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-06T07:43:31.677Z","etag":null,"topics":["attention","deep-learning","keras","layers","lstm","nlp","normalization","rnn"],"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/zimmerrol.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":"2018-06-10T16:21:47.000Z","updated_at":"2024-03-25T19:59:49.000Z","dependencies_parsed_at":"2022-11-03T20:09:04.482Z","dependency_job_id":null,"html_url":"https://github.com/zimmerrol/keras-utility-layer-collection","commit_stats":null,"previous_names":["flashtek/keras-layer-collection"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimmerrol%2Fkeras-utility-layer-collection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimmerrol%2Fkeras-utility-layer-collection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimmerrol%2Fkeras-utility-layer-collection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimmerrol%2Fkeras-utility-layer-collection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zimmerrol","download_url":"https://codeload.github.com/zimmerrol/keras-utility-layer-collection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223779728,"owners_count":17201287,"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","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":["attention","deep-learning","keras","layers","lstm","nlp","normalization","rnn"],"created_at":"2024-10-03T11:57:55.041Z","updated_at":"2024-11-09T03:15:00.695Z","avatar_url":"https://github.com/zimmerrol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keras Utility \u0026 Layer Collection [WIP]\nCollection of custom layers for Keras which are missing in the main framework. These layers might be useful to reproduce current state-of-the-art deep learning papers using Keras.\n\n## Applications\n\nUsing this library the following research papers have been reimplemented in Keras:\n\n- [Attention is all you need](https://github.com/FlashTek/attention-is-all-you-need-keras)\n- [Show, attend and tell](https://github.com/FlashTek/show-attend-and-tell-keras)\n\n## Overview of implemented Layers\n\nAt the moment the `Keras Layer Collection` offers the following layers/features:\n\n- [Scaled Dot-Product Attention](#sdpattention)\n- [Multi-Head Attention](#mhatn)\n- [Layer Normalization](#layernorm)\n- [Sequencewise Attention](#seqatn)\n- [Attention Wrapper](#atnwrapper)\n\n### Scaled Dot-Product Attention \u003ca name=\"sdpattention\"\u003e\u003c/a\u003e\n\nImplementation as described in [Attention Is All You Need](https://arxiv.org/abs/1706.03762). Performs a non-linear transformation on the values `V` by comparing the queries `Q` with the keys `K`. The illustration below is taken from the paper cited above.\n\n\u003cimg src=\"https://i.imgur.com/7zDGedN.jpg\" height=250\u003e\n\n### Multi-Head Attention \u003ca name=\"mhatn\"\u003e\u003c/a\u003e\nImplementation as described in [Attention Is All You Need](https://arxiv.org/abs/1706.03762). This is basically just a bunch a [Scaled Dot-Product Attention](#sdpattention) blocks whose output is combined with a linear transformation. The illustration below is taken from the paper cited above.\n\n\u003cimg src=\"https://i.imgur.com/c0xLAfS.jpg\" height=250\u003e\n\n### Layer Normalization \u003ca name=\"layernorm\"\u003e\u003c/a\u003e\n\n\n### Sequencewise Attention \u003ca name=\"seqatn\"\u003e\u003c/a\u003e\nThis layer applies various attention transformations on data. It needs a time-series of queries and a time-series of values to calculate the attention and the final linear transformation to obtain the output. This is a faster version of the general attention technique. It is similar to the `global attention` method described in [Effective Approaches to Attention-based Neural Machine Translation](https://arxiv.org/abs/1508.04025)\n\n### Attention Wrapper \u003ca name=\"atnwrapper\"\u003e\u003c/a\u003e\nThe idea of the implementation is based on the paper [Effective Approaches to Attention-based Neural Machine Translation](https://arxiv.org/abs/1508.04025). This layer can be wrapped around any `RNN` in `Keras`. It calculates for each time step of the `RNN` the attention vector between the previous output and all input steps. This way, a new attention-based input for the `RNN` is constructed. This input is finally fed into the `RNN`. This technique is similar to the `input-feeding` method described in the paper cited. The illustration below is taken from the paper cited above.\n\n\u003cimg src=\"https://i.imgur.com/AZKWSd2.png\" height=300\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimmerrol%2Fkeras-utility-layer-collection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzimmerrol%2Fkeras-utility-layer-collection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimmerrol%2Fkeras-utility-layer-collection/lists"}