Skip to content

Instantly share code, notes, and snippets.

View piyush2896's full-sized avatar
🎯
Focusing

Piyush Malhotra piyush2896

🎯
Focusing
View GitHub Profile
import pandas as pd
import numpy as np
def get_train_data():
df = pd.read_csv('datasets/all_stocks_5yr.csv')
data_aal = df[df['Name'] == 'AAL']
X_train = data_aal[data_aal.columns[1:5]].values[:-1]
Y_train = np.expand_dims(data_aal['open'].values[1:], 1)
return X_train, Y_train
li = []
for i in range(10):
n = int(input('Enter a no: '))
li.append(n)
max_val = li[0]
for ele in li:
if ele > max_val:
max_val = ele
def get_grade(marks):
if marks >= 80:
return 'A'
elif marks >= 65:
return 'B'
elif marks >= 50:
return 'C'
elif marks >= 35:
return 'D'
return 'E'
name = input('Enter Student Name: ')
roll_no = int(input('Enter Roll No: '))
subjects_list = ['Maths',
'Physics',
'Chemistry',
'English',
'Python']
print('\n' + '-' * 10 + 'GRADING CRITERIA' + '-' * 10)
no = int(input('Enter a positive number: '))
if no % 2 == 0:
print(no, 'is even.')
else:
print(no, 'is odd')
a = 10
b = 5
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a // b)
print(a % b)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@piyush2896
piyush2896 / resnet50.py
Created January 4, 2018 08:31
ResNet50 using TensorFlow.
import tensorflow as tf
from pprint import pprint
def get_weights(shape, name):
return tf.get_variable(name, shape=shape)
def get_bias(shape, name):
return tf.zeros(shape=shape, name=name)
@piyush2896
piyush2896 / vgg16.py
Last active December 29, 2017 11:41
Code to make Vgg-16 model in tensorflow using checkpoint available here - http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz
import tensorflow as tf
import pprint
def vgg16(is_input_trainable=False, fine_tune_last=False,
n_classes=1000, input_shape=[None, 224, 224, 3]):
"""
@params:
is_input_trainable: True in case of Neural Style Transfer to generate images
fine_tune_last: Make True if you want to fine tune the model for transfer learning