-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
519 lines (262 loc) · 18.4 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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
<!DOCTYPE html>
<html lang="en-us">
<head>
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"Website",
"@id":"https:\/\/yfjie.github.io\/",
"author": {
"@type": "Person",
"name": "fangjie yu",
"image": "https://www.gravatar.com/avatar/d09dc2d7aa5c467519e8af89f7b3d94c"
},
"name":"Hugo tranquilpeak theme",
"description":"Hugo tranquilpeak theme demo",
"url":"https:\/\/yfjie.github.io\/",
"keywords":"[]"
}
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Hugo 0.104.3 with theme Tranquilpeak 0.5.3-BETA">
<meta name="author" content="fangjie yu">
<meta name="keywords" content="">
<meta name="description" content="Hugo tranquilpeak theme demo">
<meta property="og:description" content="Hugo tranquilpeak theme demo">
<meta property="og:type" content="website">
<meta property="og:title" content="Hugo tranquilpeak theme">
<meta name="twitter:title" content="Hugo tranquilpeak theme">
<meta property="og:url" content="https://yfjie.github.io/">
<meta property="twitter:url" content="https://yfjie.github.io/">
<meta property="og:site_name" content="Hugo tranquilpeak theme">
<meta property="og:description" content="Hugo tranquilpeak theme demo">
<meta name="twitter:description" content="Hugo tranquilpeak theme demo">
<meta property="og:locale" content="en-us">
<meta name="twitter:card" content="summary">
<meta property="og:image" content="https://www.gravatar.com/avatar/d09dc2d7aa5c467519e8af89f7b3d94c?s=640">
<meta property="twitter:image" content="https://www.gravatar.com/avatar/d09dc2d7aa5c467519e8af89f7b3d94c?s=640">
<title>Hugo tranquilpeak theme</title>
<link rel="icon" href="https://yfjie.github.io/favicon.png">
<link rel="alternate" type="application/rss+xml" title="RSS" href="https://yfjie.github.io/index.xml">
<link rel="canonical" href="https://yfjie.github.io/">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" integrity="sha512-H9jrZiiopUdsLpg94A333EfumgUBpO9MdbxStdeITo+KEIMaNfHNvwyjjDJb+ERPaRS6DpyRlKbvPUasNItRyw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://yfjie.github.io/css/style-h6ccsoet3mzkbb0wngshlfbaweimexgqcxj0h5hu4h82olsdzz6wmqdkajm.min.css" />
</head>
<body>
<div id="blog">
<header id="header" data-behavior="1">
<i id="btn-open-sidebar" class="fa fa-lg fa-bars"></i>
<div class="header-title">
<a class="header-title-link" href="https://yfjie.github.io/" aria-label="Go to homepage">Hugo tranquilpeak theme</a>
</div>
<a class="header-right-picture "
href="https://yfjie.github.io/#about" aria-label="Open the link: /#about">
<img class="header-picture" src="https://www.gravatar.com/avatar/d09dc2d7aa5c467519e8af89f7b3d94c?s=90" alt="Author's picture" />
</a>
</header>
<nav id="sidebar" data-behavior="1">
<div class="sidebar-container">
<div class="sidebar-profile">
<a href="https://yfjie.github.io/#about" aria-label="Read more about the author">
<img class="sidebar-profile-picture" src="https://www.gravatar.com/avatar/d09dc2d7aa5c467519e8af89f7b3d94c?s=110" alt="Author's picture" />
</a>
<h4 class="sidebar-profile-name">fangjie yu</h4>
<h5 class="sidebar-profile-bio">Super bio with markdown support <strong>COOL</strong></h5>
</div>
<ul class="sidebar-buttons">
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://yfjie.github.io/" title="Home">
<i class="sidebar-button-icon fas fa-lg fa-home" aria-hidden="true"></i>
<span class="sidebar-button-desc">Home</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://yfjie.github.io/categories" title="Categories">
<i class="sidebar-button-icon fas fa-lg fa-bookmark" aria-hidden="true"></i>
<span class="sidebar-button-desc">Categories</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://yfjie.github.io/tags" title="Tags">
<i class="sidebar-button-icon fas fa-lg fa-tags" aria-hidden="true"></i>
<span class="sidebar-button-desc">Tags</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://yfjie.github.io/archives" title="Archives">
<i class="sidebar-button-icon fas fa-lg fa-archive" aria-hidden="true"></i>
<span class="sidebar-button-desc">Archives</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://yfjie.github.io/#about" title="About">
<i class="sidebar-button-icon fas fa-lg fa-question" aria-hidden="true"></i>
<span class="sidebar-button-desc">About</span>
</a>
</li>
</ul>
<ul class="sidebar-buttons">
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://github.com/yfjie" target="_blank" rel="noopener" title="GitHub">
<i class="sidebar-button-icon fab fa-lg fa-github" aria-hidden="true"></i>
<span class="sidebar-button-desc">GitHub</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://stackoverflow.com/users/636472/kakawait" target="_blank" rel="noopener" title="Stack Overflow">
<i class="sidebar-button-icon fab fa-lg fa-stack-overflow" aria-hidden="true"></i>
<span class="sidebar-button-desc">Stack Overflow</span>
</a>
</li>
</ul>
<ul class="sidebar-buttons">
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://yfjie.github.io/index.xml" title="RSS">
<i class="sidebar-button-icon fas fa-lg fa-rss" aria-hidden="true"></i>
<span class="sidebar-button-desc">RSS</span>
</a>
</li>
</ul>
</div>
</nav>
<div id="main" data-behavior="1"
class="
hasCoverMetaIn
">
<section class="postShorten-group main-content-wrap">
<article class="postShorten postShorten--thumbnailimg-bottom">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title">
<a class="link-unstyled" href="https://yfjie.github.io/post/notion-linux-command/" aria-label="Open the post: ">
</a>
</h1>
<div class="postShorten-meta post-meta">
<time datetime="0001-01-01T00:00:00Z">
January 1, 1
</time>
</div>
</div>
<div class="postShorten-excerpt">
Linux command 安装Anaconda:
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D (首先从清华源下载安装包)
./Anaconda3-2021.11-Linux-x86_64.sh # ubuntu、ContOS等 source ~/.bashrc # 激活 conda -V # 检查是否安装成功 Linux Ubuntu Conda 虚拟环境 激活
1、未进入虚拟环境时:
直接 conda activate env_name
2、在虚拟环境中时
执行两次source deactivate命令
(或两次 conda deactivate命令)
conda -h # 查看帮助 conda config -h conda config --show-sources # 查看镜像源 conda create -n env_name python=version_number # 修改镜像源 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ vim ~/.condarc # 直接编辑配置文件 channels: - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/ - https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ - defaults # 安装包 pip install pkg_name==xxx wsl使用
<p>
<a href="https://yfjie.github.io/post/notion-linux-command/" class="postShorten-excerpt_link link" aria-label="Open the post: ">Continue reading</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title">
<a class="link-unstyled" href="https://yfjie.github.io/post/%E7%99%BE%E5%BA%A6paddle-fluid.layers.fc-api%E8%AF%B4%E6%98%8E/" aria-label="Open the post: ">
</a>
</h1>
<div class="postShorten-meta post-meta">
<time datetime="0001-01-01T00:00:00Z">
January 1, 1
</time>
</div>
</div>
<div class="postShorten-excerpt">
学习百度的PaddlePaddle框架时,看到第一个线性回归的例子,对其中的fluid.layers.fc()函数使用有点困惑,查看官方API文档,感觉写的也不是特别清晰(可能是我理解的不好),经过一些思考后感觉应该是理解了,这里做一下总结。 下面是部分代码:
# 定义X数值 train_data=numpy.array([[1.0], [2.0], [3.0], [4.0]]).astype('float32') # 定义期望预测的真实值y_true y_true = numpy.array([[2.0], [4.0], [6.0], [8.0]]).astype('float32') # 定义输入数据类型 x = fluid.data(name="x", shape=[None, 1], dtype='float32') y = fluid.data(name="y", shape=[None, 1], dtype='float32') # 搭建全连接网络 y_predict = fluid.layers.fc(input=x, size=1, act=None) fluid.layers.fc接口如下
paddle.fluid.layers.fc(input, size, num_flatten_dims=1, param_attr=None, bias_attr=None, act=None, name=None) 参数说明: input :多维Tensor或多个Tensor组成的list,输入Tensor的shape至少是2。 size: 全连接层输出单元的数目,即输出Tensor的特征维度。 num_flatten_dims(int):在计算时,输入首先会被扁平化(flatten)为一个二维矩阵,之后再与权重(weights)相乘。参数 num_flatten_dims 决定了输入Tensor的flatten方式。 param_attr:指定权重参数属性的对象。默认值为None,表示使用默认的权重参数属性。 bias_attr:指定偏置参数属性的对象。默认值为None,表示使用默认的偏置参数属性。 act:应用于输出上的激活函数,如tanh、softmax、sigmoid,relu等。 name(str,可选):一般无需设置,默认值为None。
fluid.layers.fc函数重点是前三个参数,输入Tensor的shape至少是2是理解这个API的核心,具体是不管输入Tensor的shape是多少,都会根据num_flatten_dims扁平化为二维矩阵,其中第一维是batch_size,第二维是输入Tensor的特征维度,计算时与一个权重矩阵相乘,输出shape为 [batch_size,size]的Tensor。
例如, 假设X是一个五维的Tensor,其shape为(2, 3, 4, 5, 6), 若 num_flatten_dims=3,则扁平化的矩阵shape为: (2x3x4,5x6)=(24,30) ,最终输出Tensor的shape为 (24,size) 。
<p>
<a href="https://yfjie.github.io/post/%E7%99%BE%E5%BA%A6paddle-fluid.layers.fc-api%E8%AF%B4%E6%98%8E/" class="postShorten-excerpt_link link" aria-label="Open the post: ">Continue reading</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title">
<a class="link-unstyled" href="https://yfjie.github.io/post/%E7%99%BE%E5%BA%A6paddlepaddle%E5%AE%89%E8%A3%85%E4%BD%BF%E7%94%A8/" aria-label="Open the post: ">
</a>
</h1>
<div class="postShorten-meta post-meta">
<time datetime="0001-01-01T00:00:00Z">
January 1, 1
</time>
</div>
</div>
<div class="postShorten-excerpt">
一直想学习一下百度的paddle框架,按照官方教程安装时,感觉步骤写的太繁琐,于是根据之前安装其他框架的经验进行尝试,使用最简单的anaconda方式进行安装,很快成功,记录一下过程。
一、 安装准备
anaconda CUDA10.0、cudnn paddlepaddle-gpu离线包(选择红色框选中的) url:https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ 二、安装步骤 1.创建虚拟环境 conda create -n paddle_env python=3.5 2.激活环境 activate paddle_env 3.安装paddle框架 conda install paddlepaddle-gpu-1.6.2-py35_gpu_cuda10.0_windows.tar.bz2 (注意:使用pip install 命令安装会报错,原因还不清楚) 4.安装环境验证 使用python进入python解释器,输入import paddle.fluid,再输入 paddle.fluid.install_check.run_check()。如果出现“Your Paddle Fluid is installed succesfully!”,说明成功安装。 (说明:输入import paddle.fluid可能会报错,提示找不到某些包,pip install 进行安装即可) 比如提示找不到‘nltk’包 pip 命令安装
<p>
<a href="https://yfjie.github.io/post/%E7%99%BE%E5%BA%A6paddlepaddle%E5%AE%89%E8%A3%85%E4%BD%BF%E7%94%A8/" class="postShorten-excerpt_link link" aria-label="Open the post: ">Continue reading</a>
</p>
</div>
</div>
</article>
</section>
<footer id="footer" class="main-content-wrap">
<span class="copyrights">
© 2022 fangjie yu. All Rights Reserved
</span>
</footer>
</div>
</div>
<div id="about">
<div id="about-card">
<div id="about-btn-close">
<i class="fa fa-times"></i>
</div>
<img id="about-card-picture" src="https://www.gravatar.com/avatar/d09dc2d7aa5c467519e8af89f7b3d94c?s=110" alt="Author's picture" />
<h4 id="about-card-name">fangjie yu</h4>
<div id="about-card-bio">Super bio with markdown support <strong>COOL</strong></div>
<div id="about-card-job">
<i class="fa fa-briefcase"></i>
<br/>
Your job title
</div>
<div id="about-card-location">
<i class="fa fa-map-marker-alt"></i>
<br/>
France
</div>
</div>
</div>
<div id="cover" style="background-image:url('https://yfjie.github.io/images/cover.jpg');"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/highlight.min.js" integrity="sha512-z+/WWfyD5tccCukM4VvONpEtLmbAm5LDu7eKiyMQJ9m7OfPEDL7gENyDRL3Yfe8XAuGsS2fS4xSMnl6d30kqGQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js" integrity="sha512-uURl+ZXMBrF4AwGaWmEetzrd+J5/8NRkWAvJx5sbPSSuOb0bZLqf+tOzniObO00BjHa/dD7gub9oCGMLPQHtQA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://yfjie.github.io/js/script-yqzy9wdlzix4lbbwdnzvwx3egsne77earqmn73v9uno8aupuph8wfguccut.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-gE8KAQyFIzV1C9+GZ8TKJHZS2s+n7EjNtC+IMRn1l5+WYJTHOODUM6JSjZhFhqXmc7bG8Av6XXpckA4tYhflnw==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/apache.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-EWROca+bote+7Oaaar1F6y74iZj1r1F9rm/ly7o+/FwJopbBaWtsFDmaKoZDd3QiGU2pGacBirHJNivmGLYrow==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/go.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-GDVzAn0wpx1yVtQsRWmFc6PhJiLBPdUic+h4GWgljBh904O3JU10fk9EKNpVyIoPqkFn54rgL2QBG4BmUTMpiQ==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/http.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-UgZlma8NzkrDb/NWgmLIcTrH7i/CSnLLDRFqCSNF5NGPpjKmzyM25qcoXGOup8+cDakKyaiTDd7N4dyH4YT+IA==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/less.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-lot9koe73sfXIrUvIPM/UEhuMciN56RPyBdOyZgfO53P2lkWyyXN7J+njcxIIBRV+nVDQeiWtiXg+bLAJZDTfg==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/nginx.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-Zd3e7XxHP00TD0Imr0PIfeM0fl0v95kMWuhyAS3Wn1UTSXTkz0OhtRgBAr4JlmADRgiXr4x7lpeUdqaGN8xIog==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/puppet.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-qtqDO052iXMSP+5d/aE/jMtL9vIIGvONgTJziC2K/ZIB1yEGa55WVxGE9/08rSQ62EoDifS9SWVGZ7ihSLhzMA==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/scss.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-1NmkjnEDnwwwcu28KoQF8vs3oaPFokQHbmbtwGhFfeDsQZtVFI8zW2aE9O8yMYdpdyKV/5blE4pSWw4Z/Sv97w==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/stylus.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-B2wSfruPjr8EJL6IIzQr1eAuDwrsfIfccNf/LCEdxELCgC/S/ZMt/Uvk80aD79m7IqOqW+Sw8nbkvha20yZpzg==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/swift.min.js"></script>
<script async crossorigin="anonymous" defer integrity="sha512-28oDiQZGKUVN6wQ7PSLPNipOcmkCALXKwOi7bnkyFf8QiMZQxG9EQoy/iiNx6Zxj2cG2SbVa4dXKigQhu7GiFw==" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/languages/yaml.min.js"></script>
<script>
$(document).ready(function() {
hljs.configure({ classPrefix: '', useBR: false });
$('pre.code-highlight > code, pre > code').each(function(i, block) {
if (!$(this).hasClass('codeblock')) {
$(this).addClass('codeblock');
}
hljs.highlightBlock(block);
});
});
</script>
</body>
</html>