[ 首頁 / 搜尋 / 管理Discord ] [ Komica首頁 ] [ 跨版面 ] [ 雜談 / / 攝影 / 運動 ] [ 人工智慧 / 程設交流 ] [ 蔚藍檔案 / 英雄聯盟 / 米哈遊 / Minecraft / 魔物獵人 / 勝利女神:妮姬 / Pokémon / 刀劍亂舞 ]

/ai/ - 人工智慧

機器學習 深度學習 AI繪圖
名稱
Email
主題
回覆
檔案
嵌入
Options
密碼 (用來刪除檔案。)
  • Allowed file types:jpg, jpeg, png, gif, mp4, webm
  • Max filesize is 10 MB.
  • Max image dimensions are 10000 x 10000.
  • You may upload 1 per post.

  [Go to bottom]   [Catalog]   [返回]   [Archive]   [Featured]

File: 1698771161328.jpg (91.29 KB, 850x761, __hoshimachi_suisei_hololi….jpg)

acbdab7f No.5

要怎樣才叫做深度學習啊
是只要有用到類神經網路就算
還是一定要很多隱藏層才算?
如果我弄兩層dense layer
和一層dense layer當output
然後把他叫做深度學習模型
這樣會不會很low

另外我最近還在學上面那個簡單的類神經網路
發現如果我兩個隱藏層都不設定activation
訓練結果就很差,但如果用ReLU,訓練結果就突然好超多,為什麼啊

還有就是我的target是只有0跟1兩個值的二元分佈
所以我output的dense layer的activation是用softmax
我測試損失函數用BCE跟MAE
為什麼用MAE的時候output會比較偏向二元分佈
用BCE的反而會讓output有一點點在0.5附近的啊

554f5a8a No.19

Activation是個非綫性的過程,沒有Activation的網絡可以被簡化為一個綫性方程。

acbdab7f No.24

File: 1698867759612.png (19.91 KB, 1003x374, bce_mae.png)

>>19
感謝,原來是這個原因

另外的那個問題是類似附圖那樣
有一點講錯了是sigmoid才對,因為target只有一個dimension
具體來說是如下的測試
import numpy as np
from matplotlib import pyplot as plt
from tensorflow import keras
from sklearn.datasets import make_blobs
from sklearn.model_selection import train_test_split

def get_mlp(loss):
mlp = keras.Sequential([
keras.Input(n_features),
keras.layers.Dense(32,activation='relu'),
keras.layers.Dense(32,activation='relu'),
keras.layers.Dense(1,activation='sigmoid')
])
mlp.compile(optimizer='adam', loss=loss)
return mlp

n_features = 8
x, y = make_blobs(n_samples=(81920, 38400), n_features=8,
centers=None, cluster_std=[30, 15])
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=.25)
mlp1 = get_mlp('bce')
mlp2 = get_mlp('mae')

history = mlp1.fit(x_train, y_train, epochs=30, batch_size=1024,
use_multiprocessing=True, workers=4, verbose=2)
history = mlp2.fit(x_train, y_train, epochs=30, batch_size=1024,
use_multiprocessing=True, workers=4, verbose=2)

yp1 = mlp1.predict(x_test)
yp2 = mlp2.predict(x_test)
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))
_ = ax1.hist(yp1, bins=50)
_ = ax2.hist(yp2, bins=50)

927a2a6b No.41

>>24
BCE不太關注中間的值。
https://ai.stackexchange.com/a/26654

75cd4a44 No.50

>>41
我可以理解0.5的loss比較少所以不太關注
可是這感覺很難解釋為什麼靠邊邊還是比MAE差



[Go to top] [Catalog] [返回][Post a Reply]
刪除貼文 [ ]
[ 首頁 / 搜尋 / 管理Discord ] [ Komica首頁 ] [ 跨版面 ] [ 雜談 / / 攝影 / 運動 ] [ 人工智慧 / 程設交流 ] [ 蔚藍檔案 / 英雄聯盟 / 米哈遊 / Minecraft / 魔物獵人 / 勝利女神:妮姬 / Pokémon / 刀劍亂舞 ]