aboutsummaryrefslogtreecommitdiff
path: root/losses.py
diff options
context:
space:
mode:
authorLogan Bauman <logan_bauman@brown.edu>2022-05-04 15:23:40 -0400
committerLogan Bauman <logan_bauman@brown.edu>2022-05-04 15:23:40 -0400
commit4ad25cde30edf19f6bd128d6f54c6396cab49773 (patch)
treec8a7a2f8b64603c6924a6b113b0e2a405957bb9a /losses.py
parent4c48370de02f5db3681bd35228c69faafe3df57a (diff)
model arch started
Diffstat (limited to 'losses.py')
-rw-r--r--losses.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/losses.py b/losses.py
index 0128749a..0affdb91 100644
--- a/losses.py
+++ b/losses.py
@@ -3,13 +3,18 @@ from tensorflow.keras.layers import \
Conv2D, MaxPool2D, Dropout, Flatten, Dense
import numpy as np
+
+from skimage import transform
import hyperparameters as hp
class YourModel(tf.keras.Model):
""" Your own neural network model. """
- def __init__(self):
+ def __init__(self, content_image, style_image): #normalize these images to float values
super(YourModel, self).__init__()
-
+
+ self.content_image = content_image
+ self.style_image = transform.resize(style_image, np.shape(style_image), anti_aliasing=True)
+ self.x = tf.Variable(tf.random.uniform(np.shape(content_image)), trainable=True)
self.alpha = 1
self.beta = 1
@@ -53,6 +58,8 @@ class YourModel(tf.keras.Model):
activation="relu", name="block5_conv3"),
MaxPool2D(2, name="block5_pool"),
]
+ for layer in self.vgg16:
+ layer.trainable = False
self.head = [
# Dropout(.2),