Skip to content

Instantly share code, notes, and snippets.

View adityajn105's full-sized avatar

Aditya Jain adityajn105

View GitHub Profile
@adityajn105
adityajn105 / keras_cnn_mnist.py
Created July 8, 2018 17:34
Classification of MNIST Digits dataset using CNN using Keras
import numpy as np
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense,Conv2D,MaxPooling2D
from keras.layers import Flatten,Dropout,Activation
#create a model
model = Sequential()
model.add(Conv2D(64,(5,5),input_shape=(28,28,1),data_format="channels_last",strides=(1,1),padding="valid",activation="relu"))
@adityajn105
adityajn105 / svm.py
Created July 8, 2018 17:35 — forked from mblondel/svm.py
Support Vector Machines
# Mathieu Blondel, September 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)
@adityajn105
adityajn105 / keras_ann_mnist.py
Created July 8, 2018 17:39
Classification of MNIST dataset by ANN using Keras
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense,Activation,Dropout
from keras.datasets import mnist
from keras.utils import np_utils
no_epochs = 30
batch_size=150 #1000
v_length = 784
@adityajn105
adityajn105 / meanshift_from_scratch.py
Created July 8, 2018 21:05
MeanShift algorithm for clustering of data.
"""
Author : Aditya Jain
Contact: [email protected]
"""
import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot')
import numpy as np
@adityajn105
adityajn105 / ann_mnist_tensorflow.py
Created July 17, 2018 08:32
Neural Network for MNIST using TensorFlow
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/mnist",one_hot=True)
n_nodes_hl1 = 500
n_nodes_hl2 = 500
n_nodes_hl3 = 500
n_classes = 10
batch_size = 100
@adityajn105
adityajn105 / Readme.md
Last active November 7, 2019 07:14
Readme.md Template

Markdown Cheatsheet


Heading 1

Markup :  # Heading 1 #

-OR-

@adityajn105
adityajn105 / README-Template.md
Created July 17, 2018 08:39 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@adityajn105
adityajn105 / colab_important_snipplets.py
Last active September 19, 2020 12:11
Google Colab important code snipplets
### Download a file to Local System from Colab
from google.colab import files
with open('example.txt', 'w') as f:
f.write('some content')
files.download('example.txt')
#======================================================================================================
#upload file to Colab from Local System
from google.colab import files
uploaded = files.upload()
@adityajn105
adityajn105 / basic_sql.txt
Last active September 4, 2021 08:08
Basic SQL and Mongo DB
SQL COMMANDS TYPE
1. DDL (Data Definition Language)
Data Definition Language, DDL, is the part of SQL that allows a database user to create and restructure database objects,
such as the creation or the deletion of a table.
CREATE TABLE, ALTER TABLE, DROP TABLE, CREATE INDEX, ALTER INDEX, DROP INDEX, CREATE VIEW, DROP VIEW
2. DML (Data Manipulation Language)
Data Manipulation Language, DML, is the part of SQL used to manipulate data within objects of a relational database.
INSERT, UPDATE, DELETE
3. DQL (Data Query Language)
SELECT
@adityajn105
adityajn105 / basics.md
Last active November 11, 2020 04:19
Important Python Functionalities and Libraries

1. lambda Function

It is an anonymous function which can be used as a parameter function with sorted/sort,bisect,map,filter,reduce

>> lambda x: x*2;
>> lambda (x,y) : x+y

2. map

It is used to perform some operations on all items of sequence in one line and get a map object is iterable and can be converted to sequence