Skip to content

Instantly share code, notes, and snippets.

@vinupriyesh
vinupriyesh / pickingUpCSharpFromJava.md
Created January 30, 2021 17:44
Picking up C# from Java
  • Parameters can be passed by value or reference
  • ref or out keyword makes it pass by reference
  • const is always static
  • constants and method names are PascalCase
  • Open braces({) are NOT placed in same line
  • foreach (element in iterable-item)
@vinupriyesh
vinupriyesh / pytorch_basic_rnn.ipynb
Last active February 6, 2018 12:38
Basic RNN using pytorch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vinupriyesh
vinupriyesh / pytorch_basic.ipynb
Created February 4, 2018 18:44
Hello world pytorch network
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vinupriyesh
vinupriyesh / nn3.py
Created November 7, 2017 14:28
2 Layer neural network to categories images as in dataset http://www.cs.toronto.edu/~kriz/cifar.html
'''
Dataset is taken from http://www.cs.toronto.edu/~kriz/cifar.html
2 layer neural network to categorize a 32x32 pixel color image in 10 different categories
@Author : Vinu Priyesh V.A.
'''
import matplotlib.pyplot as plt
import numpy as np
def unpickle(file):
import pickle
@vinupriyesh
vinupriyesh / nn2.py
Created November 4, 2017 15:49
Simple neural network to predict XOR gate in python
"""
A simple neural network with 1 hidden layer and 4 neurons, an enhancement to the previous logistic regression to compute the XOR
@Author : Vinu Priyesh V.A.
"""
import numpy as np
#Compute functions for OR, AND, XOR, this will be used to generate the test set and to validate our results
def compute(x,m,label):
if(label == "XOR"):
return np.logical_xor(x[0,:],x[1,:]).reshape(1,m).astype(int)
@vinupriyesh
vinupriyesh / nn1.py
Created November 1, 2017 11:49
Very simple Logistic Regression using Neural Network to perform OR, AND, XOR
"""
Performing OR, AND, XOR operation using logistic regression which is a very simple neural network without any hidden layer
This model cannot predict XOR just like any other logistic regression as the XOR cannot be seperated by a straight line
@Author : Vinu Priyesh V.A.
"""
import numpy as np
#Compute functions for OR, AND, XOR, this will be used to generate the test set and to validate our results
def compute(x,m,label):
if(label == "XOR"):