This file contains hidden or 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
| C++ 8 hrs 30 mins █████▉░░░░░░░░░░░░░░░ 28.4% | |
| Markdown 7 hrs 48 mins █████▍░░░░░░░░░░░░░░░ 26.1% | |
| TypeScript 3 hrs 5 mins ██▏░░░░░░░░░░░░░░░░░░ 10.3% | |
| Java 2 hrs 56 mins ██░░░░░░░░░░░░░░░░░░░ 9.8% | |
| C 2 hrs 20 mins █▋░░░░░░░░░░░░░░░░░░░ 7.8% |
This file contains hidden or 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
| import tensorflow as tf | |
| from tensorflow import keras | |
| from tensorflow.keras.preprocessing.text import Tokenizer | |
| from tensorflow.keras.preprocessing.sequence import pad_sequences | |
| sentences = [ | |
| 'I love eating at McDonalds', | |
| 'I love the food here' | |
| ] |
This file contains hidden or 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
| /* Ultrasonic distance sensor HC-SR04 demo sketch | |
| * | |
| * This sketch calculates the distance between the HC-SR04 sensor and | |
| * an object directly infront of it. | |
| * | |
| * | |
| * | |
| * Components | |
| * ---------- | |
| * - Arduino Uno |
This file contains hidden or 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
| import dask | |
| import dask.dataframe as dd | |
| df = dask.datasets.timeseries() | |
| #Unlike Pandas, Dask DataFrames are lazy and so no data is printed here. | |
| df | |
| df.dtypes |
This file contains hidden or 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
| from dask.distributed import Client | |
| client = Client() | |
| client |
This file contains hidden or 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
| import dask.array as da | |
| x = da.random.random((10000, 10000), chunks=(1000, 1000)) | |
| x | |
| y = x + x.T | |
| z = y[::2, 5000:].mean(axis=1) | |
| z | |
| z.compute() |
This file contains hidden or 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
| # Importing the Keras libraries and packages | |
| import keras | |
| from keras.models import Sequential #used to initialize the NN | |
| from keras.layers import Dense #used to build the hidden Layers | |
| from keras.layers import Dropout | |
| # Initialising the ANN | |
| classifier = Sequential() | |
| # Adding the input layer and the first hidden layer with dropout |
This file contains hidden or 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
| import pandas as pd | |
| # Importing the dataset | |
| dataset = pd.read_csv('/Users/stevengong/Desktop/Deep-Learning-course/Volume 1 - Supervised Deep Learning/Part 1 - Artificial Neural Networks (ANN)/Section 4 - Building an ANN/Churn_Modelling.csv') | |
| X = dataset.iloc[:, 3:13].values | |
| y = dataset.iloc[:, 13].values | |
| # Encoding categorical data | |
| from sklearn.preprocessing import LabelEncoder, OneHotEncoder | |
| from sklearn.compose import ColumnTransformer |
This file contains hidden or 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
| # Predicting the Test set results | |
| y_pred = classifier.predict(X_test) | |
| y_pred = (y_pred > 0.5) | |
| # Making the Confusion Matrix | |
| from sklearn.metrics import confusion_matrix | |
| cm = confusion_matrix(y_test, y_pred) |
This file contains hidden or 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
| # Fitting the ANN to the Training set | |
| classifier.fit(X_train, y_train, batch_size = 10, epochs = 100) |
NewerOlder