Skip to content
Snippets Groups Projects
Commit 8796764c authored by Alex Rubinsteyn's avatar Alex Rubinsteyn
Browse files

upgrading keras, trying to figure out why output changes

parent 7d889baf
No related branches found
No related tags found
No related merge requests found
......@@ -81,11 +81,13 @@ def make_network(
model.add(Embedding(
input_dim=embedding_input_dim,
output_dim=embedding_output_dim,
input_length=input_size,
init=init))
model.add(Flatten())
input_size = input_size * embedding_output_dim
layer_sizes = (input_size,) + tuple(layer_sizes)
for i, dim in enumerate(layer_sizes):
if i == 0:
# input is only conceptually a layer of the network,
......
......@@ -59,6 +59,7 @@ class Mhc1BindingPredictor(object):
else:
filename = self.allele + ".hdf"
path = join(model_directory, filename)
print("HDF path: %s" % path)
if not exists(path):
raise ValueError("Unsupported allele: %s" % (
original_allele_name,))
......@@ -71,7 +72,9 @@ class Mhc1BindingPredictor(object):
init=INITIALIZATION_METHOD,
dropout_probability=DROPOUT_PROBABILITY,
compile_for_training=True)
print("before", len(self.model.get_weights()), self.model.get_weights()[0][0])
self.model.load_weights(path)
print("after", len(self.model.get_weights()), self.model.get_weights()[0][0])
_allele_model_cache[self.allele] = self.model
def __repr__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment