- 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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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"): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.