Markup : # Heading 1 #
-OR-
| 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")) |
| # 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) |
| 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 |
| """ | |
| Author : Aditya Jain | |
| Contact: [email protected] | |
| """ | |
| import matplotlib.pyplot as plt | |
| from matplotlib import style | |
| style.use('ggplot') | |
| import numpy as np |
| 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 |
| ### 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() |
| 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 |
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
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