Skip to content

Commit

Permalink
Merge pull request #10 from CornellDataScience/edge-training
Browse files Browse the repository at this point in the history
Edge training
  • Loading branch information
dhan0779 authored Dec 3, 2023
2 parents b6b1877 + 8ad046c commit 38039e0
Show file tree
Hide file tree
Showing 22 changed files with 763 additions and 1,820 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Images/**
**/cmake_install.cmake
**/CMakeCache.txt
camera
src/lfwa/**
47 changes: 47 additions & 0 deletions src/model/EdgeTraining.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from Siamese_Network import SiameseNetwork
from tensorflow.keras.optimizers import Adam
from data_loader import DataLoader

import os

WIDTH = HEIGHT = 105
CEELS = 1
seed = 0
loss_type = "binary_crossentropy"

data_path = "realtime"

train_path = os.path.join(
data_path, "train.pickle"
) # A path for the train file

siamese = SiameseNetwork(
seed=seed,
width=WIDTH,
height=HEIGHT,
cells=CEELS,
loss=loss_type,
metrics=["accuracy"],
optimizer=Adam(lr=0.00005),
dropout_rate=0.4,
)

loader = DataLoader(
width=WIDTH,
height=HEIGHT,
cells=CEELS,
data_path=data_path,
output_path=train_path,
)
loader.load(set_name="train")

siamese.fit(
weights_file="weights/weights.h5",
train_path=train_path,
validation_size=0.2,
batch_size=32,
epochs=2,
early_stopping=True,
patience=5,
min_delta=0.1,
)
1,633 changes: 0 additions & 1,633 deletions src/model/Siamese_Network.ipynb

This file was deleted.

Loading

0 comments on commit 38039e0

Please sign in to comment.