Repository: tensorflow/addons

Issue:
Add new API type: Keras Callback
Per #58 and our monthly discussion in March, Keras Callbacks seem like they are within scope for TF Addons. This new addition will require:

- Adding a new directory in `tensorflow_addons` which will hold keras callbacks
- Some initial contribution guidelines for adding new callbacks 
    - e.g. sub-class the abstract base class
-  Addition to the projects central BUILD file
- Updating the README/CONTRIBUTINg docs

This will ideally include a new callback as an example, but not necessarily.


Discussion:
@seanpmorgan  I would like work on this.. I am creating a branch in my fork to work on it.. do you want the single PR or multiple incremental ones ? Is there any Callback feature you are looking for ? i am thinking of implementing OneCycleLR Policy as an example. Thanks in advance

P.S : My Understanding is to set up the folder structure with corresponding BUILD and README file for callbacks and then port a sample callback from tf.contrib using the latest tf2 keras api.. Is my understanding correct ?
@Gokkulnath Any update on this? 

@Squadrick Thanks for reminding me. I am new to opensource contribution so was not sure how to proceed further. I have the folder structure ready. I need help on how the callbacks need to be implemented?  Should i inherit from tf.keras.callbacks.Callback and create custom callback ? 

**P.S:** Shall i proceed with OneCycleLR or do you have an simpler Callback in mind ?
Can we add more details to contributor's Guide so that it will be easy for newcomers ? Especially explaining the project folder structure and writing tests?
I am not sure how tests can be written for a callback. 
Thanks in advance
@Gokkulnath Took a look at your folder structure, it's just what we need. One small nit, you need to set your name and email for your commits by using `git config` like [this](https://confluence.atlassian.com/bitbucket/configure-your-dvcs-username-for-commits-950301867.html#ConfigureyourDVCSusernameforcommits-ConfigureyourGitusername/email).

As for the implementation, you'll need to inherit from [`tf.keras.callbacks.Callback`](https://github.com/tensorflow/tensorflow/blob/c22bc7989677bc438de87cd12915dbb50d01a0ce/tensorflow/python/keras/callbacks.py#L420). Check out [`LearningRateScheduler`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/callbacks.py#L1315) for a working example of how a callback in implemented. [Here](https://github.com/tensorflow/tensorflow/blob/c22bc7989677bc438de87cd12915dbb50d01a0ce/tensorflow/python/keras/callbacks_test.py#L805) is how that callback is tested.

You can proceed with OneCycleLR since you've gotten started. 

Resolving patch:
diff --git a/tensorflow_addons/__init__.py b/tensorflow_addons/__init__.py
--- a/tensorflow_addons/__init__.py
+++ b/tensorflow_addons/__init__.py
@@ -72,6 +72,7 @@ def _ensure_tf_install():
 
 # Local project imports
 from tensorflow_addons import activations
+from tensorflow_addons import callbacks
 from tensorflow_addons import image
 from tensorflow_addons import layers
 from tensorflow_addons import losses
diff --git a/tensorflow_addons/callbacks/__init__.py b/tensorflow_addons/callbacks/__init__.py
new file mode 100755
--- /dev/null
+++ b/tensorflow_addons/callbacks/__init__.py
@@ -0,0 +1,19 @@
+# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
+#
+# 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.
+# ==============================================================================
+"""A module containing callbacks that conform to Keras API."""
+
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function


Test patch: