我正在測驗 Tensorflow,但我無法弄清楚模型的結構。例如,在官方檔案中有以下指示:
A Sequential model is appropriate for a plain stack of layers where each layer has exactly one input tensor and one output tensor.
...
A Sequential model is not appropriate when:
- Your model has multiple inputs or multiple outputs
- Any of your layers has multiple inputs or multiple outputs
- You need to do layer sharing
- You want non-linear topology (e.g. a residual connection, a multi-branch model)
這是否意味著模型僅接受 1 種值型別的資料作為輸入/輸出或僅接受 1 種值作為輸入/輸出?
我想要做的是使用兩個十六進制值來預測第三個十六進制值,為此,我將資料集按位結構化,例如:
hex0[0], hex0[1],.... hex0[n], hex1[0], hex1[1], ... hex1[n], result[0], result[1]... result[n]
0 ,1 ,..., 1 , 1 , 9 , ...,1 , 1 , 1 ,... , 0
keras.Sequential 模型適用于這類問題嗎?
uj5u.com熱心網友回復:
這意味著它只接受一種型別的資料(所有數值或所有分類資料),因為在順序模型中,所有輸入值都按順序通過所有層。
我更喜歡 keras.io 中的檔案 https://keras.io/api/models/sequential/#sequential-class
在您的情況下,所有輸入資料都是相同的型別,因此您可以使用順序模型。
輸入是:[hex0[0],hex1[0]
輸出結果[0]
輸入和輸出陣列的形狀非常重要。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/426826.html
