Skip to content

Instantly share code, notes, and snippets.

View neerajshukla1911's full-sized avatar
🎯
Focusing

Neeraj Shukla neerajshukla1911

🎯
Focusing
View GitHub Profile
@neerajshukla1911
neerajshukla1911 / hello_world.c
Created June 23, 2020 13:05 — forked from kripken/hello_world.c
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}
@neerajshukla1911
neerajshukla1911 / hello_world.c
Created June 23, 2020 13:05 — forked from kripken/hello_world.c
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}
# Count files directorywise
-a | cut -d/ -f2 | sort | uniq -c | sort -nr
@neerajshukla1911
neerajshukla1911 / export_keras_model_for_serving.py
Created September 7, 2017 06:22
export keras model to serving
# coding: utf-8
# In[10]:
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
#from keras import backend as K
from keras.layers.core import K
K.set_learning_phase(0)
import tensorflow as tf
import keras
# Flags for defining the tf.train.ClusterSpec
tf.app.flags.DEFINE_string("ps_hosts", "",
"Comma-separated list of hostname:port pairs")
tf.app.flags.DEFINE_string("worker_hosts", "",
"Comma-separated list of hostname:port pairs")
# Flags for defining the tf.train.Server
import tensorflow as tf
import keras
# Flags for defining the tf.train.ClusterSpec
tf.app.flags.DEFINE_string("ps_hosts", "",
"Comma-separated list of hostname:port pairs")
tf.app.flags.DEFINE_string("worker_hosts", "",
"Comma-separated list of hostname:port pairs")
# Flags for defining the tf.train.Server
@neerajshukla1911
neerajshukla1911 / export keras model to tensorflow format
Created July 8, 2017 16:51
export keras model to tensorflow format
# coding: utf-8
# In[10]:
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
#from keras import backend as K
from keras.layers.core import K
K.set_learning_phase(0)
from sklearn.metrics import confusion_matrix
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sn
from sklearn.metrics import accuracy_score
import json
predicted_csv_filepath = '/home/neeraj/keras_jobs/sleeve_length_men_final_weights_prediction.csv'
class_indices_filepath = "/home/neeraj/keras_jobs/sleeve_length_men4/inception_v3.cls"
@neerajshukla1911
neerajshukla1911 / keras_evaluation_script
Last active August 14, 2018 13:32
keras_evaluation_script
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "5"
from keras.models import model_from_json
from keras.preprocessing.image import array_to_img, img_to_array, load_img
import numpy as np
import json
from os import path
from keras.applications.inception_v3 import preprocess_input
import csv
@neerajshukla1911
neerajshukla1911 / keras_fine_tune_example.py
Created June 18, 2017 07:01
Keras Fine Tune example
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from keras.models import Sequential, load_model
from keras.layers import Dropout, Flatten, Dense, Input, GlobalAveragePooling2D
from keras.engine.training import Model
import tensorflow as tf