From 1893475a364321c93c1e5ed538391bb38803e4d0 Mon Sep 17 00:00:00 2001 From: beta Date: Sun, 1 May 2022 20:56:49 +0900 Subject: [PATCH] (#3) Defense: Impl. Denoiser --- src/defense/models.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/defense/models.py b/src/defense/models.py index 6df6cb6..069d9ac 100644 --- a/src/defense/models.py +++ b/src/defense/models.py @@ -1,5 +1,6 @@ from typing import List from typings.models import Model +from utils.layers import SlqLayer import numpy as np import tensorflow as tf @@ -54,3 +55,17 @@ def predict(epoch, logs): ) return [keras.callbacks.LambdaCallback(on_epoch_end=predict)] + + +class Denoiser(Model): + def _model(self) -> keras.Model: + return keras.Sequential([SlqLayer()]) + + def pre_train(self): + pass + + def post_train(self): + pass + + def custom_callbacks(self) -> List[keras.callbacks.Callback]: + pass