-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
494 lines (331 loc) · 22.1 KB
/
index.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=https://www.kilians.net/">
<script type="text/javascript">
t1 = window.setTimeout(function(){ window.location.href = "https://www.kilians.net/"; },3000);
</script>
<title>Blog of Kilian Obermeier</title>
<meta name="description" content="A Random Walk Through Computer Science">
<meta property="og:locale" content="en_US">
<meta property="og:type" content="website">
<meta property="og:title" content="A Random Walk Through Computer Science">
<meta property="og:description" content="A Random Walk Through Computer Science">
<meta property="og:url" content="https://theblog.github.io">
<meta property="og:site_name" content="The Blog">
<meta name="twitter:card" content="summary">
<meta name="twitter:description" content="A Random Walk Through Computer Science">
<meta name="twitter:title" content="A Random Walk Through Computer Science">
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
<link rel="manifest" href="/favicons/site.webmanifest">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="https://code.cdn.mozilla.net/fonts/fira.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ion-rangeslider/2.1.6/css/ion.rangeSlider.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github-gist.min.css">
<link rel="stylesheet" href="/css/lib/ion.rangeSlider/css/ion.rangeSlider.skinFlat.css">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/post-util.css">
<link rel="stylesheet" href="/css/nav.css">
<link rel="stylesheet" href="/css/posts-overview.css">
</head>
<body>
<div id="main-navbar-sticky-background"></div>
<nav role="navigation" id="main-navbar" class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" data-target="#main-navbar-collapse" data-toggle="collapse" class="navbar-toggle collapsed" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-brand">
<a href="https://theblog.github.io">
<div id="logo-title"><img src="/images/logo.png" alt="Site logo"></div>
<div id="logo-subtitle">A Random Walk Through Computer Science</div>
</a>
</div>
</div>
<div id="main-navbar-collapse" class="collapse navbar-collapse">
<h5><a href="https://theblog.github.io">Posts</a></h5>
<div class="nav navbar-nav">
<h5 class="navigation-year">2021</h5>
<ul>
<li>
<a href="/post/from-tensorflow-to-pytorch/">PyTorch for TensorFlow Users - A Minimal Diff</a>
</li>
</ul>
<h5 class="navigation-year">2019</h5>
<ul>
<li>
<a href="/post/convolution-in-autoregressive-neural-networks/">Convolutions in Autoregressive Neural Networks</a>
</li>
</ul>
<h5 class="navigation-year">2017</h5>
<ul>
<li>
<a href="/post/gini-coefficient-intuitive-explanation/">Intuitive Explanation of the Gini Coefficient</a>
</li>
<li>
<a href="/post/swift-icloud-key-value-store/">iCloud Key-Value Storage in Swift 3</a>
</li>
<li>
<a href="/post/jekyll-github-pages-gulp-babel-directory-structure/">Directory Structure for Jekyll / GitHub Pages with Gulp and Babel</a>
</li>
<li>
<a href="/post/character-language-model-lstm-tensorflow/">An Interactive Character-Level Language Model</a>
</li>
</ul>
<h5 class="navigation-year">2016</h5>
<ul>
<li>
<a href="/post/visualizing-travel-times-with-multidimensional-scaling/">Visualizing Travel Times with Multidimensional Scaling</a>
</li>
</ul>
<h5 class="navigation-year">2015</h5>
<ul>
<li>
<a href="/post/some-facts-i-did-not-know-about-java/">Some facts I did not know about Java</a>
</li>
</ul>
</div>
<h5><a href="/about/">About</a></h5>
</div>
</div>
</nav>
<section class="wrapper">
<div id="content" class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="headings">
<h1><a href="/post/from-tensorflow-to-pytorch/">PyTorch for TensorFlow Users - A Minimal Diff</a></h1>
<h5>
<span><i class="fa fa-calendar-o"></i> 07 March 2021</span>
</h5>
</div>
</div>
<div class="panel-body post-body">
<p>This is a migration guide for TensorFlow users that already know how neural networks work and what a tensor is. I have been using TensorFlow since 2016, but I switched to PyTorch a year ago. Although the key concepts of both frameworks are pretty similar, especially since TF v2, I wanted to make sure that I use PyTorch's API properly and don't overlook some critical difference. Therefore, I read through the currently listed beginner-level PyTorch <a href="https://pytorch.org/tutorials/">tutorials</a>, the 14 notes in the PyTorch <a href="https://pytorch.org/docs/stable/index.html">documentation</a> (as of version 1.8.0), the top-level pages of the Python API like <a href="https://pytorch.org/docs/stable/tensors.html"><code>torch.Tensor</code></a> and <a href="https://pytorch.org/docs/stable/distributions.html"><code>torch.distributions</code></a>, and some intermediate tutorials. For each tutorial and documentation page, I list the insights that I consider relevant for TensorFlow users.</p>
<a href="/post/from-tensorflow-to-pytorch/">Read more</a>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="headings">
<h1><a href="/post/convolution-in-autoregressive-neural-networks/">Convolutions in Autoregressive Neural Networks</a></h1>
<h5>
<span><i class="fa fa-calendar-o"></i> 28 February 2019</span>
</h5>
</div>
</div>
<div class="panel-body post-body">
<p>This post explains how to use one-dimensional causal and dilated convolutions in autoregressive neural networks such as WaveNet. For implementation details, I will use the notation of the <code>tensorflow.keras.layers</code> package, although the concepts themselves are framework-independent.</p>
<p>
Say we have some temporal data, for example recordings of human speech. At a sample rate of 16,000 Hz, one second of recorded speech is a one-dimensional array of 16,000 values, as visualized <a href="https://deepmind.com/blog/wavenet-generative-model-raw-audio/#gif-8">here</a>. Based on the recordings we have, we can compute a probabilistic model of the value at the next time step given the values at the previous time steps. Having a good model for this would be really helpful as it would allow us to generate speech ourselves.
</p>
<p>
A simple approach would be to model the next value using an affine transformation (linear combination + bias) of the four previous values. Implemented in Keras, this would be a single <code>Dense</code> layer with <code>units=1</code>:
</p>
<figure>
<img src="/images/posts/convolution-autoregressive-nns/01-simple-concept.svg" width="154px" height="131px">
</figure>
<a href="/post/convolution-in-autoregressive-neural-networks/">Read more</a>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="headings">
<h1><a href="/post/gini-coefficient-intuitive-explanation/">Intuitive Explanation of the Gini Coefficient</a></h1>
<h5>
<span><i class="fa fa-calendar-o"></i> 10 October 2017</span>
</h5>
</div>
</div>
<div class="panel-body post-body">
<p>The Gini coefficient is a popular metric on Kaggle, especially for imbalanced class values. But googling "Gini coefficient" gives you mostly economic explanations. Here is a descriptive explanation with regard to using it as an evaluation metric in classification. The Jupyter Notebook for this post is <a href="https://www.kaggle.com/batzner/gini-coefficient-an-intuitive-explanation">here</a>.</p>
<p><strong>TL;DR:</strong> The Gini coefficients are the orange areas. The normalized Gini coefficient is the left one divided by the right one.</p>
<figure>
<img src="/images/posts/gini-coefficient/excerpt-figure.png" alt="Visualization of the normalized gini coefficient">
</figure>
<a href="/post/gini-coefficient-intuitive-explanation/">Read more</a>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="headings">
<h1><a href="/post/swift-icloud-key-value-store/">iCloud Key-Value Storage in Swift 3</a></h1>
<h5>
<span><i class="fa fa-calendar-o"></i> 09 August 2017</span>
</h5>
</div>
</div>
<div class="panel-body post-body">
The iCloud key-value storage is like the <code>UserDefaults</code> but synced across devices. It also survives uninstalls of the app. I used it today to add iCloud backups to <a href="https://itunes.apple.com/us/app/emoji-diary-daily-journal-with-emoticons/id1247061044?mt=8">Emoji Diary</a>. It required 4 lines of code.
<h3>Activate the iCloud capability</h3>
<p>Select your project in Xcode and then select the target under "Project and Targets". Activate iCloud and check "Key-Value storage".</p>
<img src="/images/posts/swift-icloud-key-value-store/project-settings.png" alt="Screenshot of project settings in Xcode">
<a href="/post/swift-icloud-key-value-store/">Read more</a>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="headings">
<h1><a href="/post/jekyll-github-pages-gulp-babel-directory-structure/">Directory Structure for Jekyll / GitHub Pages with Gulp and Babel</a></h1>
<h5>
<span><i class="fa fa-calendar-o"></i> 07 August 2017</span>
<span><i class="fa fa-github"></i> <a href="https://github.com/batzner/github-pages-boilerplate"> Source Code</a></span>
</h5>
</div>
</div>
<div class="panel-body post-body">
<ul>
<li><strong><a href="https://jekyllrb.com/" target="_blank">Jekyll</a></strong> is the most popular static site generator.</li>
<li><strong><a href="https://pages.github.com/" target="_blank">GitHub Pages</a></strong> hosts your jekyll sites for free under *.github.io.</li>
<li><strong><a href="https://gulpjs.com/" target="_blank">Gulp</a></strong> lets you automate your build process (minifying .css files, concatenating all .js files etc.).</li>
<li><strong><a href="https://babeljs.io/" target="_blank">Babel</a></strong> lets you write ES6 <i>(cool new JavaScript)</i> even though not all browsers support it by transpiling it into ES5 <i>(lame old JavaScript)</i>.</li>
</ul>
<p>I switched to using Jekyll for this blog yesterday and I love it. There are blog posts describing how to combine a subset of the above, but I could not find one for combining all four. However, each of these four components brings its own peculiarities to consider, so no blog post worked out of the box. Here is the solution that I ended up with:</p>
<a href="/post/jekyll-github-pages-gulp-babel-directory-structure/">Read more</a>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="headings">
<h1><a href="/post/character-language-model-lstm-tensorflow/">An Interactive Character-Level Language Model</a></h1>
<h5>
<span><i class="fa fa-calendar-o"></i> 19 February 2017</span>
<span><i class="fa fa-github"></i> <a href="https://github.com/batzner/tensorlm"> Source Code</a></span>
</h5>
</div>
</div>
<div class="panel-body post-body">
<p>I let a neural network read long texts one letter at a time. Its task was to predict the next letter based on those it had seen so far. Over time, it recognized patterns between letters. Find out what it learned by feeding it some letters below. When you click the send button on the right, it will read your text and auto-complete it.</p>
<p>You can choose between networks that read a lot of Wikipedia articles, US Congress transcripts etc.</p>
<a href="/post/character-language-model-lstm-tensorflow" style="color:white">
<div class="talk-box">
<table class="no-scroll-x">
<tr class="talk-box-heading">
<td></td>
<td class="no-stretch">
<div>Generate text from</div>
<div class="btn-group" role="group" aria-label="Dataset choice">
<button type="button" value="congress" class="btn btn-default dark">US Congress</button>
<button type="button" value="wiki" class="btn btn-default dark">Wikipedia</button>
<button type="button" value="sherlock" class="btn btn-default dark">Sherlock Holmes</button>
<button type="button" value="southPark" class="btn btn-default dark">South Park</button>
<button type="button" value="goethe" class="btn btn-default dark">Goethe</button>
</div>
</td>
<td></td>
</tr>
<tr class="talk-box-body">
<td></td>
<td>
<div class="talk-box-input">
<div class="text-input" contenteditable="true"></div>
<div class="text-input-output-bridge">...</div>
<span class="text-output"></span>
</div>
</td>
<td>
<button type="button" class="send-button btn btn-default round btn-icon">
<span class="fa fa-paper-plane"></span>
</button>
</td>
</tr>
</table>
</div>
<div class="talk-box mobile">
<div class="talk-box-heading">
<div>Generate text from</div>
<div id="talk-box-dataset-dropdown" class="btn-group dropdown-full-width">
<button type="button" value="congress" class="btn btn-default dropdown-toggle dark">
<span class="choice">US Congress</span> <span class="caret"></span>
</button>
</div>
</div>
<div class="talk-box-body">
<div class="talk-box-input">
<div class="text-input" contenteditable="true"></div>
<div class="text-input-output-bridge">...</div>
<span class="text-output"></span>
</div>
<button type="button" class="send-button btn btn-default dark">
Send
</button>
</div>
</div>
</a>
<a href="/post/character-language-model-lstm-tensorflow/">Read more</a>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="headings">
<h1><a href="/post/visualizing-travel-times-with-multidimensional-scaling/">Visualizing Travel Times with Multidimensional Scaling</a></h1>
<h5>
<span><i class="fa fa-calendar-o"></i> 13 January 2016</span>
</h5>
</div>
</div>
<div class="panel-body post-body">
Which map is correct?
<div class="gmaps clearfix">
<div class="gmap-container-stub"><img src="/images/posts/visualizing-travel-times-with-multidimensional-scaling/map-correct.jpg" alt="Distances map"></div>
<div class="gmap-container-stub"><img src="/images/posts/visualizing-travel-times-with-multidimensional-scaling/map-mds.jpg" alt="Durations map"></div>
</div>
<p>In a geography exam, the correct answer would be the left or upper one. It displays the actual locations of four cities in the US. But that does not make the other map entirely incorrect. It just displays other data. Specifically, it approximates the travel times between the four cities. This means that the closer two cities are on the right map the faster you can travel between them with public transport. We can calculate such maps using Multidimensional Scaling. What is Multidimensional Scaling? How can it help us to approximate travel times? And what is the relationship between the left map with the geographic locations and the right map? We are about to find out.</p>
<a href="/post/visualizing-travel-times-with-multidimensional-scaling/">Read more</a>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="panel panel-default panel-post">
<div class="panel-heading">
<div class="headings">
<h1><a href="/post/some-facts-i-did-not-know-about-java/">Some facts I did not know about Java</a></h1>
<h5>
<span><i class="fa fa-calendar-o"></i> 11 December 2015</span>
</h5>
</div>
</div>
<div class="panel-body post-body">
<p>I found out about some helpful and some surprising properties of Java 6 today. Did you know that to this day, Java has Go To statements? Here are some facts about the language I was not aware of.</p>
<a href="/post/some-facts-i-did-not-know-about-java/">Read more</a>
</div>
</div>
</div>
</div>
</div>
</section>
<footer class="footer">
<div>Powered by <a href="https://github.com/jekyll/jekyll" target="_blank">Jekyll</a>.</div>
<div style="margin-top: 5px"><a href="https://www.iubenda.com/privacy-policy/63560500/legal" style="color:inherit">Imprint and Privacy Policy</a></div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
<script src="/js/general.js"></script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script>
</body>
</html>