inputA = Input(shape=(2,))
x = Dense(4,activation='relu')(inputA)
x = Dense(2, activation='relu')(x)
x = Model(inputs=inputA,outputs=x)
inputB = Input(shape=(4,))
y = Dense(4, activation='relu',)(inputB)
y = Dense(2, activation='relu')(y)
y = Dense(2, activation='relu')(y)
y = Model(inputs=inputB,outputs=y)
from tensorflow.keras.utils import plot_model
x.summary()
y.summary()
#inputA , inputB 합치기 concat 이용
import tensorflow as tf
result = concatenate([x.output,y.output])
z = Dense(2,activation='relu')(result)
z = Dense(1,activation='linear')(z)
model = Model(inputs=[x.input, y.input], outputs=z)
model.summary()
'DeepLearning' 카테고리의 다른 글
DeepLearning - keras initializer 종류 (0) | 2022.10.31 |
---|---|
DeepLearning - tensorflow Xavier Initialization (0) | 2022.10.31 |
DeepLearning - Tensorflow 신경망 원리 (0) | 2022.10.30 |
DeepLearning - Tensorflow (Kaggle, Fashion MNIST) (0) | 2022.10.30 |
DeepLearning - Tensorflow 활성화 함수 정리 (0) | 2022.10.29 |