Skip to main content

Targeted dropout implemented in Keras

Project description

Keras Targeted Dropout

Travis Coverage Version Downloads License

Unofficial implementation of Targeted Dropout with tensorflow backend. Note that there is no model compression in this implementation.

Install

pip install keras-targeted-dropout

Usage

import keras
from keras_targeted_dropout import TargetedDropout

model = 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keras-targeted-dropout-0.5.0.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file keras-targeted-dropout-0.5.0.tar.gz.

File metadata

  • Download URL: keras-targeted-dropout-0.5.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

File hashes

Hashes for keras-targeted-dropout-0.5.0.tar.gz
Algorithm Hash digest
SHA256 673037b49e24790e2eaa24ca607212832346e5b70bda07f6440d5bb9254d6c80
MD5 fc861fe415cb91738029388687926faf
BLAKE2b-256 305a37aa62b2b90b3c0ba992addc89b11abbed79558a0ab6b5f597f12d4c676f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page