Skip to content

Instantly share code, notes, and snippets.

@Gananath
Gananath / Readme.MD
Last active April 20, 2022 07:36
Jain's Fairness Index to suppliment multiclass classification loss functions.

On a random surfing of web I came across this paper Leveraging Uncertainties in Softmax Decision-Making Models for Low-Power IoT Devices by Chiwoo Cho et.al. In this paper the author proposed using Jain’s Fairness Index(JFI) to compute uncertanity in a deep learning model in IoT devices.

Jain's Fairness Index

Instead of computing uncertanity, I thought of adding JFI as a suppliemtary criterion with our loss function to improve our model training. I have trained a model to classify iris dataset with and without Jain’s Fairness Index. There is a slight improvement in the model prediction when trained with Jain's Fairness Index.

The code for iris dataset training has been taken from here and I have only added jains_fairness_index() funciton to it. I tested this idea with this dataset alone. I have added the seed

@Gananath
Gananath / DQN.py
Created April 30, 2019 05:24
Gym cartpole DQN in tensorflow keras
## Author: Gananath R
## Deep Q-Network for gym in tensorflow keras
from collections import deque
import tensorflow as tf
import numpy as np
import random
import gym
k=tf.keras
@Gananath
Gananath / World_models.ipynb
Last active April 30, 2019 05:39
An attempt to program a world model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Gananath
Gananath / kaggle_lower_back_pain.py
Created January 12, 2017 12:03
Neural network trained in kaggles lower back pain dataset
#This is a fun project for kaggles Lower Back Pain dataset
#https://www.kaggle.com/sammy123/lower-back-pain-symptoms-dataset
#Used a simple multi layer perceptron to train
#contact: https://gananath.github.io
import pandas as pd
import numpy as np
from keras.models import Sequential
from keras.layers import Dense,Dropout
from sklearn.cross_validation import train_test_split