【发布时间】:2018-05-01 22:38:46
【问题描述】:
我正在尝试理解 JcJohnson/Karpathy 用 Lua 和 Torch 编写的 RNN 代码的一部分。感兴趣的可以在 github 上找到完整的项目。
https://github.com/jcjohnson/torch-rnn
我需要帮助的部分来自 LanguageModel.lua 文件:
if #start_text > 0 then
if verbose > 0 then
print('Seeding with: "' .. start_text .. '"')
end
local x = self:encode_string(start_text):view(1, -1)
local T0 = x:size(2)
sampled[{{}, {1, T0}}]:copy(x)
scores = self:forward(x)[{{}, {T0, T0}}]
first_t = T0 + 1
else
例如,我不知道这些是什么意思。
:view((1, -1)
:size(2)
:copy(x)
sampled[]
你知道这些是什么意思吗?或者我在哪里可以找到它们的参考资料?
谢谢你
【问题讨论】:
-
先阅读 lua 本身的语言规范?