All Projects → Rishit-dagli → Gradient Centralization Tensorflow

Rishit-dagli / Gradient Centralization Tensorflow

Licence: apache-2.0
Instantly improve your training performance of TensorFlow models with just 2 lines of code!

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Gradient Centralization Tensorflow

Niftynet
[unmaintained] An open-source convolutional neural networks platform for research in medical image analysis and image-guided therapy
Stars: ✭ 1,276 (+2735.56%)
Mutual labels:  deep-neural-networks, pip
Dm Haiku
JAX-based neural network library
Stars: ✭ 1,010 (+2144.44%)
Mutual labels:  deep-neural-networks
Letslearnai.github.io
Lets Learn AI
Stars: ✭ 33 (-26.67%)
Mutual labels:  deep-neural-networks
Knowledge Distillation Pytorch
A PyTorch implementation for exploring deep and shallow knowledge distillation (KD) experiments with flexibility
Stars: ✭ 986 (+2091.11%)
Mutual labels:  deep-neural-networks
Skater
Python Library for Model Interpretation/Explanations
Stars: ✭ 973 (+2062.22%)
Mutual labels:  deep-neural-networks
Dbn Cuda
GPU accelerated Deep Belief Network
Stars: ✭ 38 (-15.56%)
Mutual labels:  deep-neural-networks
Python Pixabay
Python 3 Pixabay's API wrapper.
Stars: ✭ 32 (-28.89%)
Mutual labels:  pip
Srrescgan
Code repo for "Deep Generative Adversarial Residual Convolutional Networks for Real-World Super-Resolution" (CVPRW NTIRE2020).
Stars: ✭ 44 (-2.22%)
Mutual labels:  deep-neural-networks
Bipropagation
Stars: ✭ 41 (-8.89%)
Mutual labels:  deep-neural-networks
Tofu
Project for an open-source python library for synthetic diagnostics and tomography for Fusion devices
Stars: ✭ 35 (-22.22%)
Mutual labels:  pip
Constrained attention filter
(ECCV 2020) Tensorflow implementation of A Generic Visualization Approach for Convolutional Neural Networks
Stars: ✭ 36 (-20%)
Mutual labels:  deep-neural-networks
Maestro
An analytical cost model evaluating DNN mappings (dataflows and tiling).
Stars: ✭ 35 (-22.22%)
Mutual labels:  deep-neural-networks
Fullstackmachinelearning
Mostly free resources for end-to-end machine learning engineering, including open courses from CalTech, Columbia, Berkeley, MIT, and Stanford (in alphabetical order).
Stars: ✭ 39 (-13.33%)
Mutual labels:  deep-neural-networks
Dl Colab Notebooks
Try out deep learning models online on Google Colab
Stars: ✭ 969 (+2053.33%)
Mutual labels:  deep-neural-networks
Ludwig
Data-centric declarative deep learning framework
Stars: ✭ 8,018 (+17717.78%)
Mutual labels:  deep-neural-networks
Densedepth
High Quality Monocular Depth Estimation via Transfer Learning
Stars: ✭ 963 (+2040%)
Mutual labels:  deep-neural-networks
Ardupi Ecg
Full HRV analysis of Arduino pulse sensor, using Python signal processing and time series techniques. Chaotic, Fourier, Wavelet, Regression, Neural Net.
Stars: ✭ 35 (-22.22%)
Mutual labels:  deep-neural-networks
Sockeye
Sequence-to-sequence framework with a focus on Neural Machine Translation based on Apache MXNet
Stars: ✭ 990 (+2100%)
Mutual labels:  deep-neural-networks
Elemnet
Deep Learning the Chemistry of Materials From Only Elemental Composition for Enhancing Materials Property Prediction
Stars: ✭ 44 (-2.22%)
Mutual labels:  deep-neural-networks
Sangita
A Natural Language Toolkit for Indian Languages
Stars: ✭ 43 (-4.44%)
Mutual labels:  deep-neural-networks

Gradient Centralization TensorFlow Twitter

PyPI DOI Upload Python Package Flake8 Lint Python Version

Binder Open In Colab

GitHub license PEP8 GitHub stars GitHub forks GitHub watchers

This Python package implements Gradient Centralization in TensorFlow, a simple and effective optimization technique for Deep Neural Networks as suggested by Yong et al. in the paper Gradient Centralization: A New Optimization Technique for Deep Neural Networks. It can both speedup training process and improve the final generalization performance of DNNs.

Installation

Run the following to install:

pip install gradient-centralization-tf

About the Examples

gctf_mnist.ipynb

Open In Colab Binder

This notebook shows the the process of using the gradient-centralization-tf Python package to train on the Fashion MNIST dataset availaible from tf.keras.datasets. It further also compares using gctf and performance without using gctf.

gctf_horses_v_humans.ipynb

Open In Colab Binder

This notebook shows the the process of using the gradient-centralization-tf Python package to train on the Horses vs Humans dataset by Laurence Moroney. It further also compares using gctf and performance without using gctf.

Usage

gctf.centralized_gradients_for_optimizer

Create a centralized gradients functions for a specified optimizer.

Arguments:

  • optimizer: a tf.keras.optimizers.Optimizer object. The optimizer you are using.

Example:

>>> opt = tf.keras.optimizers.Adam(learning_rate=0.1)
>>> opt.get_gradients = gctf.centralized_gradients_for_optimizer(opt)
>>> model.compile(optimizer = opt, ...)

gctf.get_centralized_gradients

Computes the centralized gradients.

This function is ideally not meant to be used directly unless you are building a custom optimizer, in which case you could point get_gradients to this function. This is a modified version of tf.keras.optimizers.Optimizer.get_gradients.

Arguments:

  • optimizer: a tf.keras.optimizers.Optimizer object. The optimizer you are using.
  • loss: Scalar tensor to minimize.
  • params: List of variables.

Returns:

A gradients tensor.

gctf.optimizers

Pre built updated optimizers implementing GC.

This module is speciially built for testing out GC and in most cases you would be using gctf.centralized_gradients_for_optimizer though this module implements gctf.centralized_gradients_for_optimizer. You can directly use all optimizers with tf.keras.optimizers updated for GC.

Example:

>>> model.compile(optimizer = gctf.optimizers.adam(learning_rate = 0.01), ...)
>>> model.compile(optimizer = gctf.optimizers.rmsprop(learning_rate = 0.01, rho = 0.91), ...)
>>> model.compile(optimizer = gctf.optimizers.sgd(), ...)

Returns:

A tf.keras.optimizers.Optimizer object.

Developing gctf

To install gradient-centralization-tf, along with tools you need to develop and test, run the following in your virtualenv:

git clone [email protected]:Rishit-dagli/Gradient-Centralization-TensorFlow
# or clone your own fork

pip install -e .[dev]

License

Copyright 2020 Rishit Dagli

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].