Skip to content

Instantly share code, notes, and snippets.

View Hsankesara's full-sized avatar
🙂
Learning

Heet Sankesara Hsankesara

🙂
Learning
View GitHub Profile
@Hsankesara
Hsankesara / RNN.ipynb
Last active January 17, 2019 09:16
Basic Vanilla RNN model from scratch.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hsankesara
Hsankesara / RNN.ipynb
Last active June 3, 2018 17:43
Basic RNN model in tensorflow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hsankesara
Hsankesara / RNN_Stacked.ipynb
Last active November 13, 2018 18:27
RNN Stacked Network with batchwise implementation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hsankesara
Hsankesara / checkRegularGrammer.c
Last active November 14, 2018 06:37
Automata Theory codes.
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
typedef struct Translation Translation;
typedef struct State State;
typedef struct Translation
{
struct State *nextState;
char input;
@Hsankesara
Hsankesara / qr_householder.py
Created November 23, 2018 04:48
QR factorization using Householder Transformation
"""
This is the code for QR factorization using Householder Transformation.
This program is made in python 3.5.3 but will be compatible to any python 3.4+ version
We used numpy library for matrix manipulation.
Install numpy using ** pip3 install numpy ** command on terminal.
To run the code write ** python3 qr_householder.py ** on terminal
User has to give dimension of the matrix as input in space separated format and matrix will be generated randomly.
QR factorization can be done for both square and non-square matrices and hence the code supports both.
"""
import numpy as np
@Hsankesara
Hsankesara / pyDatalog.ipynb
Last active December 13, 2018 16:55
First Order Logic in Kinship Domain
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hsankesara
Hsankesara / Genpact_Data_Analysis.ipynb
Last active December 16, 2018 21:29
RNN model combined with dense model to predict number of orders in future weeks. For more details go to https://datahack.analyticsvidhya.com/contest/genpact-machine-learning-hackathon/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Hsankesara
Hsankesara / kmeans.py
Created January 15, 2019 09:52
K-Means clustering and KNN classifier from scratch in Python3
import math
def euclidean_dist(p1, p2):
return math.sqrt(math.pow(p1[0] - p2[0], 2) + math.pow(p1[1] - p2[1], 2))
def allocate_class(x, means):
classes = {}
for clas in means:
classes[clas] = []
for idx, point in enumerate(x):
min_dist = None
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
class UNet(nn.Module):
def contracting_block(self, in_channels, out_channels, kernel_size=3):
block = torch.nn.Sequential(
torch.nn.Conv2d(kernel_size=kernel_size, in_channels=in_channels, out_channels=out_channels),
torch.nn.ReLU(),
@Hsankesara
Hsankesara / array_manipulation.cpp
Created February 13, 2019 18:31
playing with cpp
#include <stdio.h>
using namespace std;
double get_sum(int m, int n, double **array)
{
double sum;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{