Skip to content

Instantly share code, notes, and snippets.

@isaackogan
Created August 16, 2023 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaackogan/b240388c0047a1f1bb5a5bd15e1459e9 to your computer and use it in GitHub Desktop.
Save isaackogan/b240388c0047a1f1bb5a5bd15e1459e9 to your computer and use it in GitHub Desktop.
2023 Undergraduate Conference Model Architecture - UMIATR - 2023 - York University - License to View, NOT use commercially
import os.path
import shutil
from glob import glob
from typing import Optional, List
from keras import Sequential, Model
from keras.callbacks import History, Callback, ModelCheckpoint
from keras.layers import Conv2D, Dropout, MaxPooling2D, Flatten, Dense, BatchNormalization, Activation, Rescaling
from matplotlib import pyplot
import pandas as pd
class RATModelClient:
"""
Class to manage the RAT Model
"""
@classmethod
def create(cls) -> Sequential:
"""
Create the un-built version of the RAT CNN Model
:return: Sequential model
"""
model: Sequential = Sequential([
Rescaling((1. / 255), input_shape=(256, 256, 1)),
Conv2D(32, (3, 3), padding='same'),
BatchNormalization(),
Activation('relu'),
MaxPooling2D(pool_size=(2, 2), strides=(2, 2)),
Conv2D(64, (3, 3), padding='same'),
BatchNormalization(),
Activation('relu'),
MaxPooling2D(pool_size=(2, 2), strides=(2, 2)),
Conv2D(128, (3, 3), padding='same'),
BatchNormalization(),
Activation('relu'),
MaxPooling2D(pool_size=(2, 2), strides=(2, 2)),
Flatten(),
Dense(512),
BatchNormalization(),
Activation('relu'),
Dropout(0.5),
Dense(2, activation='sigmoid')
])
model.build()
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment