Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cyberzhg/keras-targeted-dropout
Targeted dropout implemented in Keras
https://github.com/cyberzhg/keras-targeted-dropout
dropout keras regularization
Last synced: 7 days ago
JSON representation
Targeted dropout implemented in Keras
- Host: GitHub
- URL: https://github.com/cyberzhg/keras-targeted-dropout
- Owner: CyberZHG
- License: mit
- Archived: true
- Created: 2018-11-26T02:36:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-27T10:20:20.000Z (over 5 years ago)
- Last Synced: 2024-11-15T04:13:26.326Z (3 months ago)
- Topics: dropout, keras, regularization
- Language: Python
- Homepage: https://pypi.org/project/keras-targeted-dropout/
- Size: 15.6 KB
- Stars: 6
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Keras Targeted Dropout
[![Travis](https://travis-ci.org/CyberZHG/keras-targeted-dropout.svg)](https://travis-ci.org/CyberZHG/keras-targeted-dropout)
[![Coverage](https://coveralls.io/repos/github/CyberZHG/keras-targeted-dropout/badge.svg?branch=master)](https://coveralls.io/github/CyberZHG/keras-targeted-dropout)
[![Version](https://img.shields.io/pypi/v/keras-targeted-dropout.svg)](https://pypi.org/project/keras-targeted-dropout/)
![Downloads](https://img.shields.io/pypi/dm/keras-targeted-dropout.svg)
![License](https://img.shields.io/pypi/l/keras-targeted-dropout.svg)Unofficial implementation of [Targeted Dropout](https://openreview.net/pdf?id=HkghWScuoQ) with tensorflow backend.
Note that there is no model compression in this implementation.## Install
```bash
pip install keras-targeted-dropout
```## Usage
```python
import keras
from keras_targeted_dropout import TargetedDropoutmodel = keras.models.Sequential()
model.add(TargetedDropout(
layer=keras.layers.Dense(units=2, activation='softmax'),
drop_rate=0.8,
target_rate=0.2,
drop_patterns=['kernel'],
mode=TargetedDropout.MODE_UNIT,
input_shape=(5,),
))
model.compile(optimizer='adam', loss='mse')
model.summary()
```* `drop_rate`: Dropout rate for each pixel.
* `target_rate`: The proportion of bottom weights selected as candidates
* `drop_patterns`: A list of names of weights to be dropped.
* `mode`: `TargetedDropout.MODE_UNIT` or `TargetedDropout.MODE_WEIGHT`.The final dropout rate will be `drop_rate` times `target_rate`.