Skip to content

Commit

Permalink
add flatten solves all my problems :')
Browse files Browse the repository at this point in the history
  • Loading branch information
kmhosny committed Jun 21, 2019
1 parent 2cddec7 commit 47b4c4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion feature_data_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def __data_generation(self, list_IDs_temp):
static = self.static_model.predict(ID)
c3d = self.c3d_model.predict(self.work_directory + ID)
# Store sample
print(X[i, ].shape)
X[i, ] = self.fusion_method(static, c3d, self.fusion_technique)

# Store class
Expand Down
5 changes: 2 additions & 3 deletions merge_streams.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import keras.backend as K
from keras.models import Model, Sequential
from keras.layers import Dense, Dropout
from keras.layers import Dense, Dropout, Flatten
import numpy as np
from feature_data_generator import FeatureDataGenerator
from sklearn.model_selection import train_test_split
Expand Down Expand Up @@ -89,6 +89,7 @@ def deep_model():
model.add(Dropout(0.5))
model.add(Dense(200, activation='relu'))
model.add(Dropout(0.5))
model.add(Flatten())
model.add(Dense(NUM_OF_CLASSES, activation='softmax'))
model.compile(
loss='mean_squared_error', optimizer='sgd', metrics=['accuracy'])
Expand All @@ -98,8 +99,6 @@ def deep_model():

def merge_streams_output(static_stream, c3d_stream, technique):
func = merge_technique[technique]
print("static stream shape", static_stream.shape)
print("c3d stream shape", c3d_stream.shape)
return func(static_stream, c3d_stream)


Expand Down

0 comments on commit 47b4c4c

Please sign in to comment.