Skip to content

Instantly share code, notes, and snippets.

View mohapatras's full-sized avatar

Bhabani mohapatras

  • Bangalore, India
  • 21:47 (UTC +05:30)
View GitHub Profile
# 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 / 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
@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 / 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
[{
"name": "Plan B",
"latitude": 12.9716,
"longitude": 77.5946
}, {
"name": "Locals",
"latitude": 12.933290,
"longitude": 77.622964
}, {
"name": "Toit",
[{
"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