Skip to content

Instantly share code, notes, and snippets.

😄

Raghav ragvri

😄
Block or report user

Report or block ragvri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ragvri
ragvri / classifier.py
Created Jun 22, 2017
Dog/cat classifier including prediction on a new image
View classifier.py
"""
Using the concept of transfer learning to improve accuracy. VGG16 is a CNN that has been trained on ImageNet data.
We first load this model upto the first fully connected layer.
"""
import numpy as np
from keras.preprocessing.image import ImageDataGenerator, img_to_array, load_img
from keras.models import Sequential
from keras.layers import Dense, Flatten, Dropout
from keras import applications
View model.py
import tensorflow as tf
import pickle
import numpy as np
import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
n_nodes_hl1 = 500
View processing.py
import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
import pickle
import numpy as np
import pandas as pd
lemmatizer = WordNetLemmatizer()
'''
View gist:82ac64443380fb5d9bdc6ccb97b126f7
Traceback (most recent call last):
File "/home/raghav/Dropbox/coding/python/snippets/intermediate_python_stuff/send_email.py", line 5, in <module>
mail = smtplib.SMTP('smpt.gmail.com', 587)
File "/usr/lib/python3.5/smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.5/smtplib.py", line 335, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.5/smtplib.py", line 306, in _get_socket
self.source_address)
File "/usr/lib/python3.5/socket.py", line 693, in create_connection
You can’t perform that action at this time.