The compiler is having trouble understanding a command you have used. Check that the command is spelled correctly. If the command is part of a package, make sure you have included the package in your preamble using \usepackage{...}. Learn more
\citeauthoryear #1#2->\def \@thisauthor {#1}\ifx \@lastauthor \@thisauthor \... l.172 } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. self-supervised, line 172
Illegal parameter number in definition of \reserved@a.
<to be read again> } l.172 } You meant to type ## instead of #, right? Or maybe a } was forgotten somewhere earlier, and things are all screwed up? I'm going to assume that you meant ##. self-supervised, line 172
Illegal parameter number in definition of \reserved@a.
<to be read again> l.172 } You meant to type ## instead of #, right? Or maybe a } was forgotten somewhere earlier, and things are all screwed up? I'm going to assume that you meant ##. self-supervised, line 172
Illegal parameter number in definition of \reserved@a.
<to be read again> 2 l.172 } You meant to type ## instead of #, right? Or maybe a } was forgotten somewhere earlier, and things are all screwed up? I'm going to assume that you meant ##. self-supervised, line 172
Undefined control sequence.
The compiler is having trouble understanding a command you have used. Check that the command is spelled correctly. If the command is part of a package, make sure you have included the package in your preamble using \usepackage{...}. Learn more
\cite ...\citeauthoryear ##1##2{\def \@thisauthor {##1}\ifx \@lastauthor \@t... l.172 } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. self-supervised, line 172
Illegal parameter number in definition of \reserved@a.
<to be read again> 1 l.172 } You meant to type ## instead of #, right? Or maybe a } was forgotten somewhere earlier, and things are all screwed up? I'm going to assume that you meant ##. self-supervised, line 172
Argument of \caption@ydblarg has an extra }.
<inserted text> \par l.172 } I've run across a `}' that doesn't seem to match anything. For example, `\def\a#1{...}' and `\a}' would produce this error. If you simply proceed now, the `\par' that I've just inserted will cause me to report a runaway argument that might be the root of the problem. But if your `}' was spurious, just type `2' and it will go away. self-supervised, line 172
Runaway argument?
{\@caption \@captype }{\@tempswatrue \@citex }\def \reserved@b {\@tempswafalse \ETC. ! Paragraph ended before \caption@ydblarg was complete. <to be read again> \par l.172 } I suspect you've forgotten a `}', causing me to apply this control sequence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best.
for element in dataset: print (element) >>> tf.Tensor(1, shape=(), dtype=int32) >>> tf.Tensor(2, shape=(), dtype=int32) >>> tf.Tensor(3, shape=(), dtype=int32)
dataset = dataset.map(lambda x: x*2) for element in dataset: print (element) >>> tf.Tensor(2, shape=(), dtype=int32) >>> tf.Tensor(4, shape=(), dtype=int32) >>> tf.Tensor(6, shape=(), dtype=int32)
然而,TensorFlow Dataset 基本上是围绕顺序访问构建的:tf.data pipeline 中的每一个操作,都会迭代他的输入并生成一个顺序的输出流,供下一个操作使用。这个 API 不支持随机访问,导致在尝试实现一些常见的机器学习工作流时会出现一些重大问题。
1 2 3 4 5
dataset[0] >>> TypeError: 'TensorSliceDataset' object does not support indexing
list(dataset.as_numpy_iterator()) >>> [1,2,3]
Data Shuffling
在训练一个深度学习模型时,训练集通常在输入模型前被 shuffle,这个操作通常会提升泛化性能。如果我们的数据 API 只支持顺序访问,要怎样实现 random shuffling 呢?一个简单但是低效的方法是将尽可能多的数据读入内存并在内存里面 shuffle。实际上,这正是 tf.data 的 shuffle 的做法!
This dataset fills a buffer with buffer_size elements, then randomly samples elements from this buffer, replacing the selected elements with new elements. For perfect shuffling, a buffer size greater than or equal to the full size of the dataset is required.
± ssh-keygen -t rsa -C "username@example.com" Generating public/private rsa key pair. Enter file inwhich to save the key (/Users/sundoge/.ssh/id_rsa): hexo