D File Edit View Insert Runtime Tools Help Allungesaved +Dode Text EX Files +Code + Text mre D [8] import os, shutil fro
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
D File Edit View Insert Runtime Tools Help Allungesaved +Dode Text EX Files +Code + Text mre D [8] import os, shutil fro
File Edit View Insert Runtime Tools Help Aceved X Code 14 Text Files A 8 [base_dir="/content/drive/Hyorive/ML LABA/UNZEPPED/dogs-s-cats [train dir os path.join(base_dir, train validation die test dir Colab Notebooks ML LABE os.path.join(basedir, "validation) os path.join(base_dir, "test) train cats die- os.path.join(train dir, cats) train dogs die os path.join(train_dir, dogs UNZIPPED validation cats dir os.path.join(validation dir, cats') validation dogs_dir os.path.join(validation dir, dogs) test_cats diros.path.join(test dogs-vs-osts.zip cats) Copy of bd-Gruph(s)p4 test dogs_dir os.path.join(test dir, dogs) Copy of 061VTZ mp4 DATABASE LAB7 gido [20) train datagen ImageDataGenerator(Pescale=1/2553 DATABASE LABZA Getting started pat val datagen train generator ImageDataGenerator(rescale-1.250y) train datagen.flow from strectory(train dir, target_size=(150, 150), batch_size-class_node-binary") validation generator val datagen. flow from directory(validation dir, target_size-(158, 150) batch_size-20,class_mode-binary db les assignment ag db.lab.cs assignment.pdf wq61VTw2.mp4 Found 2000 images belonging to 2 classes. Found 1000 images belonging to 2 classes. Share emple data Build the model the following is a suggestion for a modelif you'd like to implement a different architecture feel free to do so Build the model 1 layer convolutional layer 32, 3x3 filters, activation function relu 2 layer max pool 2x2 kernels 3 layerconvolutional layer 64, 3x3 filters, activation function relu 4 layer max pool 2x2 kernels 5 layer convolutional layer 128, 3x3 filters, activation function relu 6 layer max pool 2x2 kernels 7 laver convolutional laver 128. 3x3 filters, activation function relu comidated drive MyDrive
Q 11 0 Lab4 Assignment.ipynb File Edin View Insert. Runtime Tools Help All changes saved + Code + Text Files EX B 7 layer convolutional layer 128, 3x3 filters, activation function relu 8 layer max pool 2x2 kernels 9 layer convolutional layer 128, 3x3 filters, activation function relu 10 layer max pool 2x2 kernels 11 flaten layer 12 dense layer 512 units, activation function relu 13 output layer 1 unit, activation function sigmoid 11 modelary() Model: sequential 2" Layer (type) Output Shape ***** convads (Conv20) (hone, 148, 140, 32) max_pooling2d5 (MaxPooling2 (None, 74, 74, 12) conw20 6 (Conv20) (None, 72, 72, 64) Maxooling24 6 (MaxPooling) (None, 36, 36, 64) conval 7 (Conv2D) Chose, 34, 34, 120) max peeling207 droolingz (ose, 17, 17, 129) CON20 B (Conv2D) pooling (MaxPooling2 (None, 7, 7, 120) Flatter (Platten) (Note, 6272) (Nove, 112) drive MyDrive Colab Notebooks ML LABA UNZIPPED dogs-ve-cats.zip Copy of 06-Graph(1).mp4 Copy of vo61VTWVZ.mp4 DATABASE LAB7 gloc DATABASE LAB7 Getting started pdf db.lab.es assignment oblab cs assignment pat v61VTWVn2.04 Sharedd ves 14 18 Paran ● 18496 0 0 147564 . B 3233720 Oompleted at 10:17 AM
mp4 2.mp4 oc $ 1 mento g. menta.pdf MA TRAK [] dense 4 (Dense) (Monie, 1) 531 Total params: 3,453,121 Trainable paruns: 3,453,121 Non-trainable params: from keras daport optializers model compiled loss binary crossentropy,optimizer-optimizers.Sprop(Ir-1-4),trics-["acc"]). row keras.preprocessing. Inage Inport ImageDataGenerator train datagen ImagebataGenerator (rescale-1./255) test datagen Ing enerator (rescale-1./255) train generator tral datagen.flow_from_directory(train die, target size-(158, 150), batch size-20,class_node-binary) validation test datagen.flow_from_directory(validation din target size-(150, 150),batch_size-20,class_node-binary) Found 2000 Images belonging to 2 classes. Pound 1000 Images belonging to 2 classes. wara batch, labels batch in train generator) data batch shape, data batch, shape) labels batch shape: labels batch.shape) data batch shape: (20, 150, 150, 3) labels batch shape (20.) isturymodel.fit generator trala generator steps per och 100, pochs-20 vallitation, latavalidation generator, validation steps-10) ********] 181 16/step-3088 0.0002 cc: 0,555 val Ima 8.000 val.3219 0.6300 l, Jess: 0.474-val, 376 34m/stop-10.0573 4.00 4. 374 367/4tapless 8.6160-acc 8.4598-val, ins: 5242 a 0.000 es 30ins/stop-love.1674-acc 8.7125-vel, nis Ds compted at 10:17 AM Epoch 3/20 100/500 [ Epoch 2/20 100/100 [ Epoch 3/20 100/100 [ poch 4/20 100/100 [ Foch Le O B
X zip ph1mp4 TWVn2.mp4 179000 17.111 Apdr ignmentad gnmented pat mos 14 + Code 100/100 11 modelisave( cats and dogs 1.5") port pandas as pd plt-pd.Dataframe (history.history).plot(figsize-(8.5)) bit.grid(tru plt.set ylin(0, 1) set the vertical range to (0-1) plt, show() (0.0, 1.0) (10 Jaw 07 to All [100] 25 50 75 350 12.5 150 125 [ datagen Isegerat rotation range-te, width shift range, height shift range-0.2, shear_range-.2. 100 range-0.2, horizontal flip-true. Fill mode-nearest from keras.preprocessing sport Image frases (es.path, join(train cats ir, frame) for fname in os.itstdin(train cats de) ing path frames[3] Log Inage load Ing(leg path, target size(156, 158) DE Ted X 36s 350es/step loss: 8.1400 acc: 0.9585- val less: 8.7362- val acc: 0.7210 completed at 10:17 AM
ebooks PED s-cats zip s-Grape() mp4 cetVTWVnZ.mp4 SE LAB7000 ASE LAB7 started.pat ce essignment #9.g co assignmentes pof TWVNX mp4 ves 1mg pain names[] [ing image.load_img(img_path, target_size=(150, 150)) x image. Ing_to_array(ing) x.reshape((1,) + x.shape) -0 for batch in datagen.flow(x, batch_size-1): plt.figure (1) imgplot plt.inshow(image.array_to_ing(batch[0])) 1+1 1% 40: break plt.show() Build an adjusted model to reduce overfitting train datagen ImageDataGenerator( rescale-1./255, rotation range-40, width shift range-B.2. height shift range-0.2, sheer range-0.2. zoon range-0.2, horizontal flip-true,) Aval datagen TageDataGenerator (rescale-1./255) train generator train datagen. Flow from directory( train dir, target_size-t50, 156), batch_size-12. class_node- binary) Il validation generator val datagen.flow_from_directory( validation dir, target size-(158, 150). batch_size-32, class_node-binary") [] History-model, fit generator ( Os completed at 10:17 AM
Lab4 Assignment.ipynb de Edit View Insert Runtime Tools Help All changes saved X +Code Text T1 validation generator val datagen.flow_from_directory validation dir, drive MyDrive target_size-(150, 150), batch_size-32, class_node- binary") El history model.fit generator train_generator, steps_per_epoch-100, epochs-100, validation data-validation generator, validation steps-50) model.save('cats_and_dogs 2.1) 11 plt-pd.DataFrame (history history.plot figsize(4, 5) plt.grid(True) plt.set ylia(0, 1). Colab Notebooks ML LAB4 UNZIPPED dogs vs cata Copy of 08-Graph(1).mp4 Copy of va61VTWwv2.mp4 DATABASE LAB7 god DATABASE LAB7. Getting started pat db_lab_cs assignment 89.g. db Jab cs assignmenta.pdf vQ61VTWVnZ.mp4 Shareddrives sample_data