-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
大大您好,謝謝你提供這麼棒的source code,讓我受益良多 :)
以下我有一些關於fit generator的問題,還望大大能夠解惑~
問題1:
hist = model.fit_generator(generator=data_generator_centerloss(X=[x_train, y_train_a_class_value], Y=[y_train_a_class,y_train_a, random_y_train_a], batch_size=batch_size),
steps_per_epoch=train_num // batch_size,
validation_data=([x_test,y_test_a_class_value], [y_test_a_class,y_test_a, random_y_test_a]),
epochs=nb_epochs, verbose=1,
callbacks=callbacks)
以上是大大提供fit_generator的範本,我好奇的是為何Y=[y_train_a_class,y_train_a, random_y_train_a]有3個輸出 ? y_train_a代表什麼意思?
會有這個好奇點是因為我看在TTY.mnist.py是用.fit實踐的 --> model_centerloss.fit([x_train,y_train_value], [y_train, random_y_train], batch_size=batch_size, epochs=epochs, verbose=1, validation_data=([x_test,y_test_value], [y_test,random_y_test]), callbacks=[histories]) ,照我的理解,其為雙輸入雙輸出的格式。故我覺得.fit_generator也要為雙輸入雙輸出~
問題2
我依照雙輸入和雙輸出的想法建構自己的fit_generator,出現一個很奇怪的問題

以下是我輸入和輸出的 .shape,感覺大小是正確的

所以有點摸不著頭緒,是不是我的generator和l2_loss的格是不相符,不過我看l2_loss的型態都是?,感覺怪怪的QQ
補充
以下是我實作generator的方式:,我的generator會return這些東西

然後我的fit_generator是這樣實踐的

不好意思打擾您,真的很謝謝你提供那麼棒的程式,讓我在實踐center loss時有一個很棒的參考對象~謝謝
,Tina
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels