-
Notifications
You must be signed in to change notification settings - Fork 0
/
5.构建神经网络.html
92 lines (83 loc) · 3.19 KB
/
5.构建神经网络.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
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<title>Notebook Viewer</title>
<link href="//cdn.kesci.com/favicon.ico" type="image/x-icon" rel="shortcut icon">
<link href="https://cdn.kesci.com/nb_render/styles.css?v=201116" rel="stylesheet">
<link href="/static/nbrender.css" rel="stylesheet">
</head>
<body class="nbviewer">
<div class="container container-main">
<div id="notebook">
<div id="notebook-container">
<div class="k-loading-spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
</div>
</div>
</div>
<script src="https://static.kesci.com/lib/jquery/2.2.1/jquery.min.js"></script>
<script>
(function () {
function writeHTML(sourceStr) {
var headLibs = [
'https://static.kesci.com/lib/jquery/2.2.1/jquery.min.js',
'https://static.kesci.com/lib/require.js/2.1.22/require.min.js',
'https://static.kesci.com/lib/moment.js/2.8.4/moment.min.js',
'https://static.kesci.com/lib/twitter-bootstrap/3.3.7/js/bootstrap.min.js'
];
var bodyLibs = [
'/static/nbrender.js',
'https://static.kesci.com/lib/mathjax/2.7.5/MathJax.js?config=TeX-AMS_SVG&local=zh-hans'
];
function makeScript(url) {
return '<script src="' + url + '"><\/script>';
}
let before = '';
let after = '';
before += '<!DOCTYPE html>\n<html lang="zh-cmn-Hans"><head>';
before += document.querySelector('head').innerHTML;
before += headLibs.map(makeScript).join('\n');
const el = document.querySelector('#notebook-container');
if (el) {
before += '</head><body class="nbviewer"><div class="container container-main">';
} else {
before += '</head><body class="nbviewer"><div class="container container-main"><div id="notebook"><div id="notebook-container">';
}
if (el) {
after += '</div>';
} else {
after += '</div></div></div>';
}
after += bodyLibs.map(makeScript).join('\n');
after += '</body></html>';
document.open();
document.write(before + sourceStr + after);
document.close();
}
var loadRetry = 0;
function loadRemoteContent() {
jQuery.ajax({
method: 'GET',
url: 'https://s3.cn-north-1.amazonaws.com.cn/kesci-nbrender-content/20230422/4d201484-51e4-47fa-9092-4422136cbea3.html.gz',
dataType: 'text',
success: function (sourceStr) {
writeHTML(sourceStr);
},
error: function (jqXHR, textStatus, errorThrown) {
loadRetry++;
if (loadRetry < 5) {
window.setTimeout(loadRemoteContent, 5000);
} else {
document.querySelector('body').textContent=['加载失败', errorThrown.toString(), asyncContentUrl].join(' ');
}
}
});
}
loadRemoteContent();
})();
</script>
</body>