Skip to content

Instantly share code, notes, and snippets.

View kris-singh's full-sized avatar
🎯
Focusing

Kris Singh kris-singh

🎯
Focusing
View GitHub Profile
@kris-singh
kris-singh / segment_tree.py
Last active March 28, 2016 13:45
Segment_tree_vanilla
import math
import sys
class seg_tree:
def __init__(self,arr):
x = int(math.ceil(math.log(len(arr)) / math.log(2)))
print "x",x
self.seg_arr = [0 for i in range(0, 2*2**x)]
self.index = 0
self.low = 0
self.high = len(arr)-1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
/*
/*@filename:upload_file.php
/*@author:Kris Singh<cs15mtech11007@iith.ac.in>
/*@Date:15/06/2016
/*@package name :bump server
*/
//get data from the server and visulise it in a heat map form
require 'db_connection.php';
function get_contents($date){
@kris-singh
kris-singh / new_gist.ipynb
Created September 16, 2016 22:39
new_gist
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kris-singh
kris-singh / try.cpp
Last active February 21, 2017 11:31
#include <mlpack/core.hpp>
#include <armadillo>
#include <iostream>
#include <typeinfo>
using namespace std;
using namespace mlpack;
class GaussianInitialization
{
public:
/**
* @file example.cpp
* @author Marcus Edel
*
* Simple random agent.
*/
#include <iostream>
#include "environment.hpp"
sgd.hpp file
----------------------------------------------------------------------------------------------
enum decay_type {no_decay = 0, t_decay=1, exponential_decay=4 , step_decay=3}
... SGD {
SGD(DecomposableFunctionType& function,
const double stepSize = 0.01,
const size_t maxIterations = 100000,
const double tolerance = 1e-5,