https://github.com/cyberzhg/keras-embed-sim
Calculate similarity with embedding
https://github.com/cyberzhg/keras-embed-sim
embedding keras
Last synced: 20 days ago
JSON representation
Calculate similarity with embedding
- Host: GitHub
- URL: https://github.com/cyberzhg/keras-embed-sim
- Owner: CyberZHG
- License: mit
- Archived: true
- Created: 2018-12-09T08:51:22.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T09:41:59.000Z (almost 4 years ago)
- Last Synced: 2025-08-27T05:37:08.463Z (2 months ago)
- Topics: embedding, keras
- Language: Python
- Homepage: https://pypi.org/project/keras-embed-sim/
- Size: 15.6 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Keras Embedding Similarity
[](https://pypi.org/project/keras-embed-sim/)

\[[中文](https://github.com/CyberZHG/keras-embed-sim/blob/master/README.zh-CN.md)|[English](https://github.com/CyberZHG/keras-embed-sim/blob/master/README.md)\]
Compute the similarity between the outputs and the embeddings.
## Install
```bash
pip install keras-embed-sim
```
## Usage
```python
from tensorflow import keras
from keras_embed_sim import EmbeddingRet, EmbeddingSim
input_layer = keras.layers.Input(shape=(None,), name='Input')
embed, embed_weights = EmbeddingRet(
input_dim=20,
output_dim=100,
mask_zero=True,
)(input_layer)
output_layer = EmbeddingSim()([embed, embed_weights])
```