Skip to content

Instantly share code, notes, and snippets.

View mohapatras's full-sized avatar

Bhabani mohapatras

  • Bangalore, India
  • 17:27 (UTC +05:30)
View GitHub Profile
[{
"name": "Albariño",
"species": "Vitis vinifera 'Alvarinho'",
"description": "Albariño or Alvarinho is a variety of white wine grape grown in Galicia (northwest Spain), Monção and Melgaço (northwest Portugal), where it is used to make varietal white wines. Albariño is the Galician name for the grape. In Portugal it is known as Alvarinho, and sometimes as Cainho Branco.It was presumably brought to Iberia by Cluny monks in the twelfth century[citation needed]. Its name 'Alba-Riño' means 'the white from the Rhine' and it has locally been thought to be a Riesling clone originating from the Alsace region of France, although earliest known records of Riesling as a grape variety date from the 15th, rather than the 12th, century. It is also theorized that the grape is a close relative of the French grape Petit Manseng.It should not be confused with the Alvarinho Liláz grape of Madeira.",
"thumbnail": "https://raw.githubusercontent.com/Bhabani2077/images/master/varietalswine/albarino.png",
"image": "https://raw
[{
"name": "Plan B",
"latitude": 12.9716,
"longitude": 77.5946
}, {
"name": "Locals",
"latitude": 12.933290,
"longitude": 77.622964
}, {
"name": "Toit",
@mohapatras
mohapatras / 0_reuse_code.js
Created June 11, 2017 16:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mohapatras
mohapatras / keras_tensor_export.py
Last active June 12, 2017 08:00
Found in a comment by user @tspthomas.
'''
I managed to export a Keras model for Tensorflow Serving (not sure whether it is the official way to do
this). My first trial prior to creating my custom model was to use a trained model available on
Keras such as VGG19.
Here is how I did (I put in separate boxes to help understanding and because I use Jupyter :)):
'''
#Creating the model
import keras.backend as K
@mohapatras
mohapatras / plank_notes
Created September 14, 2017 04:13 — forked from erogol/plank_notes
Kaggle Plankton Classification winner's approach notes
FROM: http://benanne.github.io/2015/03/17/plankton.html
Meta-Tricks:
- Use %10 for validation with STRATIFIED SAMPLING (my mistake)
- Cyclic Pooling
- Leaky ReLU = max(x, a*x) learned a
- reduces overfitting with a ~= 1/3
- Orthogonal initialization http://arxiv.org/pdf/1312.6120v3.pdf
- Use larger weight decay for larger models since otherwise some layers might diverge
# memory growth options for keras and tensorflow.
from keras import backend as K
cfg = K.tf.ConfigProto()
cfg.gpu_options.allow_growth = True
K.set_session(K.tf.Session(config=cfg))
@mohapatras
mohapatras / cuda_cudnn_version.sh
Created March 23, 2018 05:45
check_cuda and cudnn versions ubuntu.
# CUDA version
nvcc --version
which nvcc
# CudaNN version
# Use the output of which nvcc to locate your cuda
cat /usr/include/x86_64-linux-gnu/cudnn_v*.h | grep CUDNN_MAJOR -A 2
@mohapatras
mohapatras / resnet.py
Last active June 15, 2022 15:14
# Resnet50 with grayscale images.
import numpy as np
import warnings
import os
import tensorflow as tf
from keras.layers import Input
from keras import layers
from keras.layers import Dense
from keras.layers import Activation
from keras.layers import Flatten
@mohapatras
mohapatras / gpu_tf_keras_memory_limit.py
Last active April 4, 2018 13:56
Assign before doing any keras operation.
# keras example imports
from keras.models import load_model
## extra imports to set GPU options
import tensorflow as tf
from keras import backend as k
###################################
# TensorFlow wizardry
config = tf.ConfigProto()