Please check the following code:

  

      gist.github.com
  

  
    https://gist.github.com/mahmksoft/34b89f802e941095dab8105bfd35d038 2

  custom_layer.py
  import tensorflow as tf
from tensorflow import keras
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import RMSprop
from tensorflow.keras.optimizers import SGD
from tensorflow.keras.layers import Flatten

ig = 0.0
im = 0.5
    This file has been truncated. show original