Skip to content

Instantly share code, notes, and snippets.

View s1998's full-sized avatar

Sudhanshu Ranjan s1998

  • Assam
View GitHub Profile
docker ps -a
docker container list
docker cp ~/Downloads/newsolnJAE_Lab1_soln.zip youthful_newton:/autograder
@s1998
s1998 / reduce_mem_keras_tf.py
Last active May 9, 2021 20:04
Restrict gpu memory in keras/tf
# Set flexible GPU usage
import tensorflow as tf
import keras.backend as ktf
from tensorflow.python.keras import backend as ktf
def get_session(gpu_fraction=0.2):
gpu_options = tf.compat.v1.GPUOptions(
per_process_gpu_memory_fraction=gpu_fraction,
allow_growth=True)
return tf.compat.v1.Session(
// There are 2 ways of doing this that I could think of.
// A.
// We deifne a bidirectional layer that takes forward dircetional rnn cell (lstm/gru..) and one backward direcional rnn cell
BidirectionalLayer<> b_unit;
// This unit has a Add() method. The method is "different" from Add method of other layers because the user needs to
// specify forward RNN cell and backward RNN cell.
// There are 2 ways I could think of doing this (A1):
template <bool forwardPolicy, class LayerType, class... Args>
void Add(Args... args){...}
@s1998
s1998 / rbfn.cpp
Last active March 15, 2018 22:44
rbfn api
// Proposed changes to the API are:
// DBSCAN clustering has a method :
size_t Cluster(const MatType& data,
arma::mat& centroids);
// KMeans clustering has a method :
void Cluster(const MatType& data,
size_t clusters,
arma::mat& centroids,