logo
Loading...

x = Dense(64, activation='relu')(x)? 想請問該如何理解這行程式 - Cupoy

如題,x = Dense(64, activation='relu')(x)想請問Dense(......

ml100,ml100-d69

x = Dense(64, activation='relu')(x)? 想請問該如何理解這行程式

2020/07/07 下午 05:11
機器學習共學討論版
Shengzhi Lin
觀看數:32
回答數:2
收藏數:0
ml100
ml100-d69

如題,x = Dense(64, activation='relu')(x)

想請問Dense(....)(x)中,(x)的表示方式是什麼意思,因為若不加入這行新加入的dense layer沒辦法執行,是否跟shape有關呢?因為error message的說明為:'Dense' object has no attribute 'shape',但是是什麼的shape呢?我不太明白

回答列表

  • 2020/07/07 下午 08:32
    Jeffrey
    贊同數:0
    不贊同數:0
    留言數:2

    x = Dense(64, activation='relu')(x)

    --> 指的是輸出64 units, 激活函數採用 relu. x是代入函數的值;

    --> shape 指的是資料的輸入維度

  • 2020/07/09 下午 03:27
    張維元 (WeiYuan)
    贊同數:0
    不贊同數:0
    留言數:0

    (x) 是執行 function 啊,你可以去看一下 Dense 的用法,他應該會回傳一個未執行的 function