์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- ๋ชจ๋์๋ฅ๋ฌ๋
- SUMBT:Slot-Utterance Matching for Universal and Scalable Belief Tracking
- ๋ฐฑ์ค
- ๋ค์ด๋๋ฏน ํ๋ก๊ทธ๋๋ฐ
- From Machine Reading Comprehension to Dialogue State Tracking: Bridging the Gap
- 2020์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌํ๊ธฐ
- ์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌ์ ๊ณต์
- Zero-shot transfer learning with synthesized data for multi-domain dialogue state tracking
- ๋ฐ์ดํฐ ํฉ์ฑ
- ์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌ ์์ ๋น
- ์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌ ์ฑ ์ถ์ฒ
- ๊ฒ์์์ง
- fasttext text classification ํ๊ธ
- ์์ฐ์ด์ฒ๋ฆฌ ๋ ผ๋ฌธ ๋ฆฌ๋ทฐ
- ์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌ์ ๊ณต์ํฉ๊ฒฉํ๊ธฐ
- classification text
- nlp๋ ผ๋ฌธ๋ฆฌ๋ทฐ
- Few Shot Dialogue State Tracking using Meta-learning
- MySQL
- dialogue state tracking
- DST fewshot learning
- ํ์ด์ฌ์ ํ์ด์ฌ๋ต๊ฒ
- DST zeroshot learning
- How Much Knowledge Can You Pack Into the Parameters of a Language Model?
- ํ๋ก๊ทธ๋๋จธ์ค
- Python
- few shot dst
- Leveraging Slot Descriptions for Zero-Shot Cross-Domain Dialogue State Tracking
- til
- ๋ฅ๋ฌ๋๊ธฐ์ด
Archives
- Today
- Total
๐ฒ์๋ผ๋๋์ฒญ๋
์ ๊ฒฝ๋ง๋ง๋ค๊ธฐ + ํ์ต์๊ณ ๋ฆฌ์ฆ ๋ง๋ค๊ธฐ ๋ณธ๋ฌธ
๋ฐ์ํ
two layer์ธ ์ ๊ฒฝ๋ง์ ๋ง๋๋ ์ฝ๋
์ ๋ ฅ - hidden- ์ถ๋ ฅ์ธต์ผ๋ก ๊ตฌ์ฑ๋์ด์๋ค.
๊ฐ์ค์น ์ด๊ธฐํ ํจ์
1 2 3 4 5 6 7 8 | def __init__(self, input_size, hidden_size, output_size, weight_init_std=0.01): # ๊ฐ์ค์น ์ด๊ธฐํ self.params = {} self.params['W1'] = weight_init_std * np.random.randn(input_size, hidden_size) self.params['b1'] = np.zeros(hidden_size) self.params['W2'] = weight_init_std * np.random.randn(hidden_size, output_size) self.params['b2'] = np.zeros(output_size) | cs |
w1์๋ ํฌ๊ธฐ๊ฐ (input_size, hidden_size)์ธ random์ซ์๊ฐ ๋ค์ด๊ฐ๋ค.
b1์๋ ํฌ๊ธฐ๊ฐ(hidden_size)์ด๊ณ 0์ด ๋ค์ด๊ฐ๋ค.
์์ธกํ๋ ์ฝ๋
1 2 3 4 5 6 7 8 9 10 | def predict(self, x): W1, W2 = self.params['W1'], self.params['W2'] b1, b2 = self.params['b1'], self.params['b2'] a1 = np.dot(x, W1) + b1 z1 = sigmoid(a1) a2 = np.dot(z1, W2) + b2 y = softmax(a2) return y | cs |
์๋๋ loss ํจ์์์ฝ๋์ด๋ค.
๊ต์ฐจ ์ํธ๋กํผ๋ฅผ ์ฌ์ฉํ์๋ค.
# x : ์ ๋ ฅ ๋ฐ์ดํฐ, t : ์ ๋ต ๋ ์ด๋ธdef loss(self, x, t):y = self.predict(x)return cross_entropy_error(y, t)์ ํ๋๋ฅผ ์๋ ค์ฃผ๋ ์ฝ๋
12345678 def accuracy(self, x, t):y = self.predict(x)y = np.argmax(y, axis=1)t = np.argmax(t, axis=1)accuracy = np.sum(y == t) / float(x.shape[0])return accuracycs ๊ธฐ์ธ๊ธฐ๋ฅผ ์๋ ค์ฃผ๋ ์ฝ๋๊ฒฐ๊ณผ๊ฐ์ผ๋ก๋ ๊ธฐ์ธ๊ธฐ๋ค์ ๋ฐฐ์ด์ด ๋์จ๋ค.
12345678910 def numerical_gradient(self, x, t):loss_W = lambda W: self.loss(x, t)grads = {}grads['W1'] = numerical_gradient(loss_W, self.params['W1'])grads['b1'] = numerical_gradient(loss_W, self.params['b1'])grads['W2'] = numerical_gradient(loss_W, self.params['W2'])grads['b2'] = numerical_gradient(loss_W, self.params['b2'])return gradscs
ํ์ต ์๊ณ ๋ฆฌ์ฆ ๋ง๋ค๊ธฐ
network = TwoLayerNet(input_size=784, hidden_size=50, output_size=10)
28*28์ธ ์ด๋ฏธ์ง๋ฅผ input์ผ๋ก ๋ฃ๊ธฐ ๋๋ฌธ์ size๋ 784, output์ 10๊ฐ์ ์ซ์๊ธฐ ๋๋ฌธ์ 10์ผ๋ก ์ง์
# ํ์ดํผํ๋ผ๋ฏธํฐiters_num = 10000 # ๋ฐ๋ณต ํ์๋ฅผ ์ ์ ํ ์ค์ ํ๋ค.train_size = x_train.shape[0]batch_size = 100 # ๋ฏธ๋๋ฐฐ์น ํฌ๊ธฐlearning_rate = 0.1ํ์ดํผ ํ๋ผ๋ฏธํฐ๋ ์ ์ ํ ์ ํด์ผ ํ๋ค.์๋๋ ํ์ต์ ํ๋ ์ฝ๋
12345678910111213141516171819202122232425262728 # 1์ํญ๋น ๋ฐ๋ณต ์iter_per_epoch = max(train_size / batch_size, 1)for i in range(iters_num):# ๋ฏธ๋๋ฐฐ์น ํ๋batch_mask = np.random.choice(train_size, batch_size)x_batch = x_train[batch_mask]t_batch = t_train[batch_mask]# ๊ธฐ์ธ๊ธฐ ๊ณ์ฐgrad = network.gradient(x_batch, t_batch)# ๋งค๊ฐ๋ณ์ ๊ฐฑ์for key in ('W1', 'b1', 'W2', 'b2'):network.params[key] -= learning_rate * grad[key]# ํ์ต ๊ฒฝ๊ณผ ๊ธฐ๋กloss = network.loss(x_batch, t_batch)train_loss_list.append(loss)# 1์ํญ๋น ์ ํ๋ ๊ณ์ฐif i % iter_per_epoch == 0:train_acc = network.accuracy(x_train, t_train)test_acc = network.accuracy(x_test, t_test)train_acc_list.append(train_acc)test_acc_list.append(test_acc)print("train acc, test acc | " + str(train_acc) + ", " + str(test_acc))cs epoch : ํ์ต๋ฐ์ดํฐ๋ฅผ ๋ชจ๋ ์์งํ์๋์ ํ์ํ๋ จ๋ฐ์ดํฐ 10000๊ฐ๋ฅผ 100๊ฐ์ ๋ฏธ๋๋ฐฐ์น๋ก ํ์ตํ ๊ฒฝ์ฐ ํ๋ฅ ์ ๊ฒฝ์ฌ ํ๊ฐ๋ฒ์ 100ํ ๋ฐ๋ณตํ๋ฉด ๋ชจ๋ ํ๋ จ๋ฐ์ดํฐ๋ฅผ ์์งํ๊ฒ ๋๋๋ฐ ์ด๊ฒฝ์ฐ 100ํ๊ฐ 1์ํญ์ด ๋๋ค.๊ฒฐ๊ณผ :
๋ฐ์ํ