Question about tutorial 30.Lin

11 views
Skip to first unread message

Burak Acar

unread,
Jul 11, 2019, 2:49:04 PM7/11/19
to knet-users
HI,
My question may be related to Julia, but I'd appreciate an explanation for the following lines of code in 30.Lin in the tutorial:

        lin = ((deepcopy(model),model(dtrn),model(dtst),zeroone(model,dtrn),zeroone(model,dtst))
        # (progress displays a bar like progress! but returns an iterator, progress! returns nothing)
               for x in takeevery(length(dtrn), progress(sgd(modelZ,repeat(dtrn,100)))))
        # Save it as a 5x100 array
        lin = reshape(collect(flatten(lin)),(5,:))

How is "lin" updated? I guess it collects sgd output at very length(dtrn), but where is it written to Lin?

Deniz Yuret

unread,
Jul 16, 2019, 2:11:13 AM7/16/19
to Burak Acar, knet-users
Dear Burak, please refer to the Julia doc sections about iterators and the iterator notebook in the tutorial.

--
You received this message because you are subscribed to the Google Groups "knet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knet-users+...@googlegroups.com.
To post to this group, send email to knet-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knet-users/43f6fbf0-c807-41c9-87cf-fea2e36ae509%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages