未验证 提交 6c40834f 编写于 作者: W wangqun 提交者: GitHub

Merge pull request #6 from wangqunbaidu/master

[d][change] 支持paddle op融合pass
...@@ -33,52 +33,52 @@ If the original model was a SavedModel, use paddle.load(). ...@@ -33,52 +33,52 @@ If the original model was a SavedModel, use paddle.load().
```bash ```bash
import Paddle from 'paddlejs'; import Paddle from 'paddlejs';
let feed = io.process({ let feed = io.process({
input: document.getElementById('image'), input: document.getElementById('image'),
params: { params: {
gapFillWith: '#000', // What to use to fill the square part after zooming gapFillWith: '#000', // What to use to fill the square part after zooming
targetSize: { targetSize: {
height: fw, height: fw,
width: fh width: fh
}, },
targetShape: [1, 3, fh, fw], // Target shape changed its name to be compatible with previous logic targetShape: [1, 3, fh, fw], // Target shape changed its name to be compatible with previous logic
// shape: [3, 608, 608], // Preset sensor shape // shape: [3, 608, 608], // Preset sensor shape
mean: [117.001, 114.697, 97.404], // Preset mean mean: [117.001, 114.697, 97.404], // Preset mean
// std: [0.229, 0.224, 0.225] // Preset std // std: [0.229, 0.224, 0.225] // Preset std
} }
}); });
const MODEL_CONFIG = { const MODEL_CONFIG = {
dir: `/${path}/`, // model URL dir: `/${path}/`, // model URL
main: 'model.json', // main graph main: 'model.json', // main graph
}; };
const paddle = new Paddle({ const paddle = new Paddle({
urlConf: MODEL_CONFIG, urlConf: MODEL_CONFIG,
options: {
multipart: true,
dataType: 'binary',
options: { options: {
multipart: true, fileCount: 1, // How many model have been cut
dataType: 'binary', getFileName(i) {
options: { return 'chunk_' + i + '.dat';
fileCount: 1, // How many model have been cut
getFileName(i) {
return 'chunk_' + i + '.dat';
}
} }
} }
}); }
});
model = await paddle.load(); model = await paddle.load();
// //
let inst = model.execute({ let inst = model.execute({
input: feed input: feed
}); });
// There should be a fetch execution call or a fetch output // There should be a fetch execution call or a fetch output
let result = await inst.read(); let result = await inst.read();
``` ```
......
...@@ -4,6 +4,9 @@ import IO from '../../src/feed/imageFeed'; ...@@ -4,6 +4,9 @@ import IO from '../../src/feed/imageFeed';
import Utils from '../../src/utils/utils'; import Utils from '../../src/utils/utils';
// 获取map表 // 获取map表
import Map from '../../test/data/map'; import Map from '../../test/data/map';
const fileDownload = require('js-file-download');
/** /**
* @file model demo 入口文件 * @file model demo 入口文件
* @author wangqun@baidu.com * @author wangqun@baidu.com
...@@ -11,25 +14,21 @@ import Map from '../../test/data/map'; ...@@ -11,25 +14,21 @@ import Map from '../../test/data/map';
*/ */
// 模型feed数据 // 模型feed数据
const feedShape = { const feedShape = {
'608': { 'mobilenetv2': {
fw: 608, fw: 224,
fh: 608 fh: 224
},
'320': {
fw: 320,
fh: 320
},
'320fused': {
fw: 320,
fh: 320
},
'separate': {
fw: 244,
fh: 244
} }
}; };
const modelType = 'separate';
// 模型fetch数据
const fetchShape = {
'mobilenetv2': [1, 1000, 1, 1]
};
const modelType = 'mobilenetv2';
const {fw, fh} = feedShape[modelType]; const {fw, fh} = feedShape[modelType];
const outputShape = fetchShape[modelType];
// 统计参数 // 统计参数
let loaded = false; let loaded = false;
let model = {}; let model = {};
...@@ -37,19 +36,21 @@ window.statistic = []; ...@@ -37,19 +36,21 @@ window.statistic = [];
async function run(input) { async function run(input) {
// const input = document.getElementById('mobilenet'); // const input = document.getElementById('mobilenet');
const io = new IO(); const io = new IO();
let feed = io.process({ let feed = io.process({
input: input, input: input,
params: { params: {
targetShape: [1, 3, fh, fw], // 目标形状 为了兼容之前的逻辑所以改个名 gapFillWith: '#000', // 缩放后用什么填充不足方形部分
targetSize: {
height: fh,
width: fw
},
scale: 256, // 缩放尺寸 scale: 256, // 缩放尺寸
width: 224, height: 224, // 压缩宽高 targetShape: [1, 3, fh, fw], // 目标形状 为了兼容之前的逻辑所以改个名
shape: [3, 224, 224], // 预设tensor形状 mean: [0.485, 0.456, 0.406],
mean: [0.485, 0.456, 0.406], // 预设期望 std: [0.229, 0.224, 0.225]
std: [0.229, 0.224, 0.225] // 预设方差 }
}}); });
console.log('feed', feed);
const path = 'model/mobileNet'; const path = 'model/mobileNet';
if (!loaded) { if (!loaded) {
...@@ -62,31 +63,45 @@ async function run(input) { ...@@ -62,31 +63,45 @@ async function run(input) {
urlConf: MODEL_CONFIG, urlConf: MODEL_CONFIG,
options: { options: {
multipart: true, multipart: true,
dataType: 'json' dataType: 'binary',
options: {
fileCount: 4, // 切成了多少文件
getFileName(i) { // 获取第i个文件的名称
return 'chunk_' + i + '.dat';
}
},
feed
} }
}); });
model = await paddle.load(); model = await paddle.load();
} }
let inst = model.execute({ let inst = model.execute({
input: feed input: feed
}); });
// 其实这里应该有个fetch的执行调用或者fetch的输出
let result = await inst.read(); let result = await inst.read();
console.dir(['result', result]); let N = outputShape[0];
// let maxItem = Utils.getMaxItem(result); let C = outputShape[1];
// document.getElementById('txt').innerHTML = Map['' + maxItem.index]; let H = outputShape[2];
// console.log('识别出的结果是' + Map['' + maxItem.index]); let W = outputShape[3];
// console.dir(['每个op耗时', window.statistic]); console.log(outputShape);
// let total = statistic.reduce((all, cur) => { let nhwcShape = [N, H, W, C];
// return all + cur.runTime; console.log(nhwcShape);
// }, 0); console.log(result.length);
// console.log('op total = ' + total);
let nchwData = Utils.nhwc2nchw(result, nhwcShape);
Utils.stridePrint(nchwData);
Utils.continuousPrint(nchwData);
// for test
// fileDownload(nchwData, "paddlejs-0.txt");
let maxItem = Utils.getMaxItem(nchwData);
console.log(maxItem);
document.getElementById('txt').innerHTML = Map['' + maxItem.index];
console.log('识别出的结果是' + Map['' + maxItem.index]);
}; };
var image = ''; var image = '';
function selectImage(file) { function selectImage(file) {
......
...@@ -3,64 +3,12 @@ ...@@ -3,64 +3,12 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>paddle web demo</title> <title>paddle web demo</title>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,initial-scale=1,viewport-fit=cover"> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<style>
p {
display: block;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0;
margin-inline-end: 0;
}
#uploadImg {
border: solid 1px #808080;
width: 100%;
padding: 10px;
background-color: #cabfbf;
color: #FFF;
font-size: 16px;
}
p.section-head {
font-variant: small-caps;
text-transform: uppercase;
letter-spacing: .17em;
line-height: 1.2em;
font-weight: 500;
margin-top: 2em;
margin-bottom: 1em;
border-left: 1px solid #EF6C00;
padding-left: 24px;
color: #818181;
}
.image-wrap {
position: relative;
}
#image {
width: 100%;
}
#myDiv {
position: absolute;
border: 1px solid #F00;
box-sizing: border-box;
}
</style>
</head> </head>
<body> <body>
<section class="title-area"> <img id="image" src="https://m.baidu.com/se/static/img/iphone/logo.png" style="max-width: 100%;">
<h1>Paddle.js: Using a pretrained mobileNet V2</h1> <input type="file" id="uploadImg">
</section> <div id="txt"></div>
<section>
<p class="section-head">Description</p>
<p>
Please upload a picture to experience online classification.
</p>
</section>
<section>
<img id="image" src="https://m.baidu.com/se/static/img/iphone/logo.png" style="max-width: 100%;">
<input type="file" id="uploadImg">
<div id="txt"></div>
</section>
<script src="index.es6"></script> <script src="index.es6"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -74,12 +74,12 @@ async function run(input) { ...@@ -74,12 +74,12 @@ async function run(input) {
params: { params: {
gapFillWith: '#000', // 缩放后用什么填充不足方形部分 gapFillWith: '#000', // 缩放后用什么填充不足方形部分
targetSize: { targetSize: {
height: fw, height: fh,
width: fh width: fw
}, },
targetShape: [1, 3, fh, fw], // 目标形状 为了兼容之前的逻辑所以改个名 targetShape: [1, 3, fh, fw], // 目标形状 为了兼容之前的逻辑所以改个名
// shape: [3, 608, 608], // 预设tensor形状 // shape: [3, 608, 608], // 预设tensor形状
mean: [117.001, 114.697, 97.404], // 预设期望 mean: [117.001 / 255, 114.697 / 255, 97.404 / 255], // 预设期望
// std: [0.229, 0.224, 0.225] // 预设方差 // std: [0.229, 0.224, 0.225] // 预设方差
} }
}); });
......
...@@ -5,45 +5,44 @@ ...@@ -5,45 +5,44 @@
<title>paddleJS demo</title> <title>paddleJS demo</title>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,initial-scale=1,viewport-fit=cover"> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,initial-scale=1,viewport-fit=cover">
<style> <style>
p { p {
display: block; display: block;
margin-block-start: 1em; margin-block-start: 1em;
margin-block-end: 1em; margin-block-end: 1em;
margin-inline-start: 0px; margin-inline-start: 0;
margin-inline-end: 0px; margin-inline-end: 0;
} }
#uploadImg { #uploadImg {
border: solid 1px gray; border: solid 1px #808080;
width: 100%; width: 100%;
padding: 10px; padding: 10px;
background-color: #cabfbf; background-color: #cabfbf;
color: white; color: #FFF;
font-size: 16px; font-size: 16px;
} }
p.section-head { p.section-head {
font-variant: small-caps; font-variant: small-caps;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.17em; letter-spacing: .17em;
line-height: 1.2em; line-height: 1.2em;
font-weight: 500; font-weight: 500;
margin-top: 2em; margin-top: 2em;
margin-bottom: 1em; margin-bottom: 1em;
border-left: 1px solid #EF6C00; border-left: 1px solid #EF6C00;
padding-left: 24px; padding-left: 24px;
color: #818181;
color: #818181; }
} .image-wrap {
.image-wrap { position: relative;
position: relative; }
} #image {
#image { width: 100%;
width: 100%; }
} #myDiv {
#myDiv { position: absolute;
position: absolute; border: 1px solid #F00;
border: 1px solid red; box-sizing: border-box;
box-sizing: border-box; }
}
</style> </style>
</head> </head>
<body> <body>
...@@ -62,17 +61,17 @@ ...@@ -62,17 +61,17 @@
<section> <section>
<p class="section-head">Model Output</p> <p class="section-head">Model Output</p>
<div class="image-wrap"> <div class="image-wrap">
<img id="mobilenet" /> <img id="mobilenet">
</div> </div>
<p>原图片</p> <p>原图片</p>
<div class="image-wrap"> <div class="image-wrap">
<img id="image" src=""/> <img id="image" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCABkAGQDASIAAhEBAxEB/8QAGwABAAIDAQEAAAAAAAAAAAAAAAcIAwUGBAL/xAA8EAABAwMCBAMFBQYGAwAAAAABAgMEAAURBgcSITFRE0FhCBQicaEVUoGRsTI2QnWysyM0NzhydIKS4f/EABsBAQADAAMBAAAAAAAAAAAAAAAEBQYBAwcC/8QAMhEAAQMCAwUFCAMBAAAAAAAAAQACAwQRBRIhEzFBYbEGUXGRwRQiMoGh0fDxJCUzYv/aAAwDAQACEQMRAD8AuXSlKIlKUoiUrmde63sujYbblxWt2Q9nwYzQBWvHU8+QHqfwzWj0LuxYtT3JNscYetsxw4ZS6oKQ6ewUOh9CB6ZqfHhlXJAahsZLBxUd1VC2TZl2qkKlK1t9v1msTSHbvc40JKzhHirAKvkOpqGxjpHZWC55Lvc4NFyVsqV57dNh3GIiZAlMyo7gyhxpYUk/iK9FfLmlpsd6Ag6hKUpXC5SlKURKUpREpWj1Vq7T2mENm9XJuMtwZQ2Ela1DuEpBOPXpTS2rdPamQs2W5NyVtjK28FC0juUqAOPWpHsk+y22Q5O+xt5rr20efJmF+7iq1bv3Z68bh3Z11RKIz6orQ8kpbJTy+ZBP41yrDrrD7b7Lim3W1BaFpOCkg5BFdVu/aHrPuHdmnUEIkvqlNK8lJcJVy+R4h+Fcqw06++2wy2px1xQQhCRkqUTgAV7Ph+z9jjyfDlHRYqozbZ2bfcq2ytUswtuGNWTwCDb2pC0J5cS1pThI+aiBVV9R3q46gvD90uj5ekPHJ+6geSUjyA7VPm7Fsft2xjFuI41wWYjbpT0+HhST+dVyrOdkqWAMlqGDUuIHIC1uvRWWLyyFzY3d1/mu82U1XJ09q+LDW8o264OpYfaJ+EKVySsdiCRk9s+lWiqou2NnevmurVCaSSlMhLzp+62g8Sv0x8yKt1VJ2zjibVsc34iNfT85KdgrnmEg7gdEpSlY5XKUpSiJQkAEk4A5k0rHJaD0dxkkgOIKSR6jFcjfqip9rW+SNR6nnXaQ4VeM6fCHkhsHCUj0Ax9a8unrvNsV5jXW3OluRHWFJ7KHmk9wRyNYLnDft9xkwJKCh6O6ppxJGMFJwawISpa0oQkqUo4SkDJJ7V7qyGLYiMAZLW5WssG578+Y77/VWu1RpSxbg2CDKntuMuLZS8xIZIDjYUkHhyQQRz6fpWt0NtRYNMXNF0L0i4TG+bKngAhs/eCR/F6kn0xXY6birgactsJ0YXHiNNKHYpQAf0qOdcbz2uzzXLfZIgurzZ4VvlzhZSewIyVfhgepryejfiNTmo6NxLNdOFvHgD46rWzCmjtNMBmUnXKFFuVvfgTWUvRpDZbcQropJGDUI3bYeX78Tar4x7oTyEls+Igdvh5K+lfdk34f96Sm9WNrwCebkRwhSB34VZ4vzFTPZrnAvFtZuNtkokxXhlDiOh7j0I6YNdv9rgH/ACHeBB+xXx/ExDmR8io2RE07sxplc1XHcrrMIbSo4Qp0jnwp68CB1PXnjryrk42+99TMCpNmtq4ueaGytK8f8iSPpT2oH1q1NaoxPwNwysfNSyD/AEioirWYRhFPXUoqqwZ3v1JPkALblUVlZJBKYoTla1XH0hqK3aosbV2tiyWl/CtCuS21jqlQ7/8Aw1t6gz2W5LolXyHxEtFDToHZWVD6g/SpzrCYzQtoa18DDoN3gRdX9FOZ4WvO9KUpVWpSUpSiLgtwdrrLq2d9peO7bp5SErdaSFJcx0KknqR0zkfpXl0RtFYdO3Jq5yJL1zlsnia8VIS2hXkoJGckeWTy+dSPUS7sbrsWkPWXTbiXriDwPShgoYPmB95X0HqeVX+H1OK1rRRQPOXoOZ32/Sr6iKkhO3kaL+vgsm++vm7PbndN2p/Nzkow+tB/y7Z6jPkoj8gc9qgJq13N2GZrVumORQCS8lhRQAOp4sY5YrfW/Q2tr60bkxZJshL58TxniEFzPPiysgqz3qa9M2i42PYi5266xlRpTcCaVtlQJAKVkcwSOhrXRz0uBUzIoHNe8uAdqL68bcu5U7mS18pfIC0AaaKtdSHsrrs6VvBgXF1X2RMUA5k5DC+gcA7eR9MHyrkUacv67T9rJs8428IK/eQyrw+EdTxdMV5LXbp90liJbYb8uQoEhplBUogdTgVoquKmrYHxSEFvHXd9iFXQvkgka9o16qavaSsEufHt2pYDfvEZhotSFN/FwpJ4kL5fw8zz+XeoLqYds9dXTRUpnTGs40qNBWkKjrfbIXHSSR0PMoyD8sVNca12F5Tdwj262uKWA4iQhhBKgeYUFAfWskzF5sCiFNNHnaL5XA6EfX88zbuo2V7jKx2U8QeCjn2b9OTLXY5t4nMlk3EoDCVDCvDTn4sdiVfTPnUsUpWJxCtfXVLp3ixd+h9FeU8AgjEY4JSlKhruSlKURR9vvqiRpzSAZgOeHNuDhYQsHBQjGVqHr0H/AJZ8qh/YrT8XUGukCehLsaEyqSppYyHCClKQR2yrP4V3ntRwnXLXZLgnPhMPOsq+a0pI/tmo62Y1LG0xrZqVOX4cOS0qM+v7gUQQr5BSRn0zXo2DwEYC91N/o4Ovbfppby3eKzdZIDXtEnwi355rv96dyb7ZNTGw2B9EMRm0Kfd8JK1KUocQSOIEAAEeWa6WwXe433YefdLrI94lvW6d4jnAlOceIkckgDoB5Vg3H2yh62uDV+tl2bjPOtJStQR4jbyR+yoEHrjl5ggCtmzp9zS+zFzsbslElce2zCXEp4QeIOK6fjVLJNhzqKnjhAEoc3NprxvrbdfmpzWVAnkc8+5Y2105aLS27/bYr+WO/wBSqjj2ef8AUuN/13v6ak7bD7P1Vs0NPNTA28I7kWRjBW0oqUQrh8xgg+tefbbaqZpPVTV5evDEpCG1o8NDJSTxDHUmpja6CmhrqeZ1nuc6wsdb7l0GCSV8EjBcAC64b2mP3/i/y1v+45Wb2f8AWcu339nTU19blvmEpYSo5DLvUY7BXTHcg96w+0x+/wDF/lrf9xyuP22jPStf2FpgErE9lw48kpUFKP5A1fU9NFUYE1ko0yX8LcVAkkdHXkt71b6lKV5StYlKUoiUpSiLVassULUlgk2eenLT6cBQ6tqH7Kh6g1W3Uu1usLPNcaZtb1yjg/4b8VPHxj1SPiB9CPzq09KusJx2pwy7Y7Fp4HqFBq6COqsXaEcVVK0WPcyEgx7ZA1PCbJyUNB5lJPfyFdBG0bvBc2XGJMy6NMOJKFplXU8K0kYIKeMkjHkRVjaVZS9rZnm7YWA99r+qjMwhg0Lyq2N7TbiWpz3q2qaS+BgKiTfDXjtk8P61qLszuhallM93VDQH8YfeUj/2SSPrVqqUj7XVBN5omu+Vj69Edg8dvccQqdLhaov01JcjXe5ycBCStDjqwO2TnA5mpr2Q24m6flKv9+bS1OUgtx4+QotA9VEjlxEcseQJ78papXXiPamergMEbAxp32107uHRfVNhTIX7RxzFKUpWXVqlKUoiUpSiJSlKIlKUoiUpSiJSlKIlKUoiUpSiL//Z">
<div id="myDiv"></div> <div id="myDiv"></div>
</div> </div>
<p>画布</p> <p>画布</p>
<canvas id="myCanvas"></canvas> <canvas id="myCanvas"></canvas>
<br/> <br>
<input type="file" id="uploadImg"/> <input type="file" id="uploadImg">
<div id="txt"></div> <div id="txt"></div>
</section> </section>
......
import 'babel-polyfill'; import 'babel-polyfill';
import Runner from '../src/executor/runner'; import Runner from '../../src/executor/runner';
import Camera from '../src/executor/camera'; import Camera from '../../src/executor/camera';
// 调试工具 // 调试工具
// import vConsole from 'vconsole'; // import vConsole from 'vconsole';
// const theConsole = new vConsole(); // const theConsole = new vConsole();
let startBtn = document.getElementById('start'); let startBtn = document.getElementById('start');
let stopBtn = document.getElementById('stop') let stopBtn = document.getElementById('stop')
// 模型输出shape
const outputShapes = {
'608': {
from: [19, 19, 25, 1],
to: [19, 19, 5, 5]
},
'320': {
from: [10, 10, 25, 1],
to: [10, 10, 5, 5]
},
'320fused': {
from: [10, 10, 25, 1],
to: [10, 10, 5, 5]
},
'tinyYolo': {
from: [10, 10, 25, 1],
to: [10, 10, 5, 5]
}
};
// 模型feed数据
const feedShape = {
'608': {
fw: 608,
fh: 608
},
'320': {
fw: 320,
fh: 320
},
'320fused': {
fw: 320,
fh: 320
},
'tinyYolo': {
fw: 320,
fh: 320
}
};
const modelPath = {
'tinyYolo': 'model/tinyYolo'
};
const modelType = 'tinyYolo';
const path = modelPath[modelType];
const runner = new Runner({ const runner = new Runner({
// 用哪个模型 // 用哪个模型
modelName: 'separate' // '608' | '320' | '320fused' | 'separate' modelName: modelType, // '608' | '320' | '320fused' | 'separate'
modelPath: path,
feedShape: feedShape[modelType],
outputShapes: outputShapes[modelType]
}); });
startBtn.disabled = true; startBtn.disabled = true;
runner.preheat() runner.preheat()
.then(() =>{ .then(() =>{
startBtn.disabled = false startBtn.disabled = false;
}); });
const domElement = document.getElementById('video'); const domElement = document.getElementById('video');
const myCanvas = document.getElementById('myDiv'); const myCanvas = document.getElementById('myDiv');
......
...@@ -5,32 +5,59 @@ ...@@ -5,32 +5,59 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>识别摄像头里的脸</title> <title>识别摄像头里的脸</title>
<style> <style>
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#myDiv { #myDiv {
position: fixed; position: fixed;
border: 1px solid red; border: 1px solid #F00;
box-sizing: border-box; box-sizing: border-box;
} }
#video { #video {
background: red; background: #F00;
} }
</style> p {
display: block;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0;
margin-inline-end: 0;
}
p.section-head {
font-variant: small-caps;
text-transform: uppercase;
letter-spacing: .17em;
line-height: 1.2em;
font-weight: 500;
margin-top: 2em;
margin-bottom: 1em;
border-left: 1px solid #EF6C00;
padding-left: 24px;
color: #818181;
}
</style>
</head> </head>
<body> <body>
<video id="video"> <section class="title-area">
</video> <h1>Paddle.js: Using a pretrained tinyYolo with WebRTC</h1>
<p> </section>
<button id="start">开始识别</button>
<button id="stop">结束</button>
</p>
<select id="videoSelect"></select>
<p id="tips">tips</p>
<div id="myDiv"></div>
<script src="./videoDemo.es6"></script> <section>
<p class="section-head">Description</p>
<p>Please start the face trace.</p>
</section>
<video id="video">
</video>
<p>
<button type="button" id="start">开始识别</button>
<button type="button" id="stop">结束</button>
</p>
<select id="videoSelect"></select>
<p id="tips">tips</p>
<div id="myDiv"></div>
<script src="./videoDemo.es6"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -4,14 +4,19 @@ ...@@ -4,14 +4,19 @@
"description": "paddle", "description": "paddle",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"server": "parcel ./src/index.html",
"mnistdemo": "parcel ./examples/mnist/index.html", "mnistdemo": "parcel ./examples/mnist/index.html",
"mobilenet": "parcel ./examples/mobileNet/index.html", "mobilenet": "parcel ./examples/mobileNet/index.html",
"tinyYolo": "parcel ./examples/tinyYolo/index.html", "tinyYolo": "parcel ./examples/tinyYolo/index.html",
"huangfan": "parcel ./examples/huangfan/index.html", "huangfan": "parcel ./examples/huangfan/index.html",
"terrorModel": "parcel ./examples/terrorModel/index.html",
"humanseg": "parcel ./examples/humanseg/index.html",
"humanStream": "parcel ./examples/humanStream/index.html --port 1234 --https",
"yolo": "parcel ./examples/yolo/index.html", "yolo": "parcel ./examples/yolo/index.html",
"videoDemo": "parcel ./examples/videoDemo.html --port 8123 --https", "videoDemo": "parcel ./examples/videoDemo.html --port 8123 --https",
"unitTest": "parcel ./test/unitTest.html", "unitTest": "parcel ./test/unitTest.html",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack -w"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.7.2", "@babel/core": "^7.7.2",
...@@ -27,6 +32,7 @@ ...@@ -27,6 +32,7 @@
"babel-preset-react": "^6.24.1", "babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1", "babel-preset-stage-0": "^6.24.1",
"babel-runtime": "^6.26.0", "babel-runtime": "^6.26.0",
"less": "^3.11.1",
"parcel-bundler": "^1.10.3", "parcel-bundler": "^1.10.3",
"webpack-cli": "^3.3.6" "webpack-cli": "^3.3.6"
}, },
...@@ -34,7 +40,12 @@ ...@@ -34,7 +40,12 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"js-file-download": "^0.4.5", "@babel/plugin-transform-runtime": "^7.6.2",
"vconsole": "^3.3.2" "@babel/runtime": "^7.7.2",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"js-file-download": "^0.4.10",
"vconsole": "^3.3.2",
"webpack": "^4.39.2",
"webpack-zepto": "0.0.1"
} }
} }
...@@ -26,6 +26,7 @@ export default class Camera { ...@@ -26,6 +26,7 @@ export default class Camera {
} }
// 访问用户媒体设备的兼容方法 // 访问用户媒体设备的兼容方法
// safari在getusermedia之后 才能拿到deviceid
run(deviceId, callback) { run(deviceId, callback) {
if (window.stream) { if (window.stream) {
window.stream.getTracks().forEach(function (track) { window.stream.getTracks().forEach(function (track) {
...@@ -41,7 +42,12 @@ export default class Camera { ...@@ -41,7 +42,12 @@ export default class Camera {
}; };
const error = this.error.bind(this); const error = this.error.bind(this);
if (this.deviceInfos.length) { if (this.deviceInfos.length) {
constraints.video.deviceId= {exact: deviceId || this.deviceInfos[0]}; constraints.video.deviceId = {exact: deviceId || this.deviceInfos[0].deviceId};
}
if (!constraints.video.deviceId) {
constraints = {
video: true
};
} }
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
......
...@@ -38,6 +38,9 @@ export default class GraphExecutor { ...@@ -38,6 +38,9 @@ export default class GraphExecutor {
else if (this.type === 'elementwise_add') { else if (this.type === 'elementwise_add') {
return this.inputs.X.concat(this.inputs.Y); return this.inputs.X.concat(this.inputs.Y);
} }
else if (this.type === 'concat') {
return this.inputs.X.concat(this.inputs.Y);
}
else if (this.type === 'relu' || this.type === 'leaky_relu') { else if (this.type === 'relu' || this.type === 'leaky_relu') {
return this.inputs.X; return this.inputs.X;
} }
...@@ -60,7 +63,13 @@ export default class GraphExecutor { ...@@ -60,7 +63,13 @@ export default class GraphExecutor {
} }
get outputsName() { get outputsName() {
if (this.type === 'conv2d') { if (this.outputs.Output) {
return this.outputs.Output;
}
else if (this.outputs.out) {
return this.outputs.out;
}
else if (this.type === 'conv2d') {
return this.outputs.Output; return this.outputs.Output;
} }
else if (this.type === 'depthwise_conv2d') { else if (this.type === 'depthwise_conv2d') {
......
...@@ -39,12 +39,15 @@ import softmax_conf from '../../shader/softmax/conf'; ...@@ -39,12 +39,15 @@ import softmax_conf from '../../shader/softmax/conf';
import batchnorm_params from '../../shader/batchnorm/params'; import batchnorm_params from '../../shader/batchnorm/params';
import batchnorm_func from '../../shader/batchnorm/main'; import batchnorm_func from '../../shader/batchnorm/main';
import batchnorm_conf from '../../shader/batchnorm/conf'; import batchnorm_conf from '../../shader/batchnorm/conf';
import reshape_params from '../../shader/reshape/params'; import reshape2_params from '../../shader/reshape2/params';
import reshape_func from '../../shader/reshape/main'; import reshape2_func from '../../shader/reshape2/main';
import reshape_conf from '../../shader/reshape/conf'; import reshape2_conf from '../../shader/reshape2/conf';
import transpose_params from '../../shader/transpose/params'; import bilinear_interp_params from '../../shader/bilinear_interp/params';
import transpose_func from '../../shader/transpose/main'; import bilinear_interp_func from '../../shader/bilinear_interp/main';
import transpose_conf from '../../shader/transpose/conf'; import bilinear_interp_conf from '../../shader/bilinear_interp/conf';
import transpose2_params from '../../shader/transpose2/params';
import transpose2_func from '../../shader/transpose2/main';
import transpose2_conf from '../../shader/transpose2/conf';
import conv2d_elementwise_add_params from '../../shader/conv2d_elementwise_add/params'; import conv2d_elementwise_add_params from '../../shader/conv2d_elementwise_add/params';
import conv2d_elementwise_add_func from '../../shader/conv2d_elementwise_add/main'; import conv2d_elementwise_add_func from '../../shader/conv2d_elementwise_add/main';
...@@ -183,15 +186,20 @@ export default { ...@@ -183,15 +186,20 @@ export default {
func: batchnorm_func, func: batchnorm_func,
confs: batchnorm_conf confs: batchnorm_conf
}, },
reshape: { reshape2: {
params: reshape_params, params: reshape2_params,
func: reshape_func, func: reshape2_func,
confs: reshape_conf confs: reshape2_conf
}, },
transpose: { bilinear_interp: {
params: transpose_params, params: bilinear_interp_params,
func: transpose_func, func: bilinear_interp_func,
confs: transpose_conf confs: bilinear_interp_conf
},
transpose2: {
params: transpose2_params,
func: transpose2_func,
confs: transpose2_conf
} }
}, },
atoms: { atoms: {
......
...@@ -108,6 +108,7 @@ export default class imageFeed { ...@@ -108,6 +108,7 @@ export default class imageFeed {
result[offset] = data[a] / 255; result[offset] = data[a] / 255;
result[offset] -= mean[k]; result[offset] -= mean[k];
result[offset] /= std[k]; result[offset] /= std[k];
//result[offset] = 0.5;
offset++; offset++;
} }
} }
...@@ -116,6 +117,46 @@ export default class imageFeed { ...@@ -116,6 +117,46 @@ export default class imageFeed {
return result; return result;
}; };
/**
* 全部转bgr * H * W
* @param shape
*/
allReshapeToBGR(imageData, opt, scaleSize) {
//const {sw, sh} = scaleSize;
const [b, c, h, w] = opt.targetShape;
let data = imageData.data || imageData;
// mean和std是介于0-1之间的
let mean = opt.mean;
let std = opt.std;
let dataLength = data.length;
// let result = new Float32Array(dataLength * 3);
let result = this.result;
// let offsetR = 0;
// let offsetG = dataLength / 4;
// let offsetB = dataLength / 2;
let offset = 0;
let size = h * w;
// h w c
for (let i = 0; i < h; ++i) {
let iw = i * w;
for (let j = 0; j < w; ++j) {
let iwj = iw + j;
for (let k = 0; k < c; ++k) {
let a = iwj * 4 + (2-k);
result[offset] = data[a];
result[offset] -= mean[2-k];
result[offset] /= std[2-k];
//result[offset] = 0.5;
offset++;
}
}
}
console.log('this is the end of reshapetorgb !!!');
console.dir(result);
return result;
};
/** /**
* 根据scale缩放图像 * 根据scale缩放图像
* @param image * @param image
...@@ -138,6 +179,8 @@ export default class imageFeed { ...@@ -138,6 +179,8 @@ export default class imageFeed {
sh = params.scale; sh = params.scale;
sw = Math.round(sh * width / height); sw = Math.round(sh * width / height);
} }
sw = params.scale;
sh = params.scale;
this.fromPixels2DContext.canvas.width = sw; this.fromPixels2DContext.canvas.width = sw;
this.fromPixels2DContext.canvas.height = sh; this.fromPixels2DContext.canvas.height = sh;
this.fromPixels2DContext.drawImage( this.fromPixels2DContext.drawImage(
...@@ -285,15 +328,16 @@ export default class imageFeed { ...@@ -285,15 +328,16 @@ export default class imageFeed {
data2 = this.fromPixels2DContext2.getImageData(0, 0, this.pixelWidth, this.pixelHeight); data2 = this.fromPixels2DContext2.getImageData(0, 0, this.pixelWidth, this.pixelHeight);
} }
else if (opt.scale) { // 兼容以前的,如果有scale就是短边缩放到scale模式 else if (opt.scale) { // 兼容以前的,如果有scale就是短边缩放到scale模式
scaleSize = this.reSize(pixels, opt); scaleSize = this.reSize(pixels, opt);
console.dir(scaleSize); console.dir(scaleSize);
console.dir(pixels); console.dir(pixels);
data = this.getImageData(opt, 0, 0, scaleSize); data = this.getImageData(opt, 0, 0, scaleSize);
data2 = this.fromPixels2DContext2.getImageData(0, 0, this.pixelWidth, this.pixelHeight); data2 = this.fromPixels2DContext2.getImageData(0, 0, this.pixelWidth, this.pixelHeight);
} }
else if (opt.targetSize) { // 如果有targetSize,就是装在目标宽高里的模式 TinyYolo的情况 else if (opt.targetSize) { // 如果有targetSize,就是装在目标宽高里的模式 TinyYolo的情况
scaleSize = this.fitToTargetSize(pixels, opt); scaleSize = this.fitToTargetSize(pixels, opt);
data = this.getImageData(opt, 0, 0, scaleSize); data = this.getImageData(opt, 0, 0, scaleSize);
data2 = this.fromPixels2DContext2.getImageData(0, 0, this.pixelWidth, this.pixelHeight); data2 = this.fromPixels2DContext2.getImageData(0, 0, this.pixelWidth, this.pixelHeight);
...@@ -309,7 +353,10 @@ export default class imageFeed { ...@@ -309,7 +353,10 @@ export default class imageFeed {
data = this.reshape(data, opt, scaleSize); data = this.reshape(data, opt, scaleSize);
} }
if (opt.targetShape) { if (opt.bgr) {
data = this.allReshapeToBGR(data, opt, scaleSize);
}
else if (opt.targetShape) {
data = this.allReshapeToRGB(data, opt, scaleSize); data = this.allReshapeToRGB(data, opt, scaleSize);
} }
return [{data: data, shape: opt.shape || opt.targetShape, name: 'image', canvas: data2}]; return [{data: data, shape: opt.shape || opt.targetShape, name: 'image', canvas: data2}];
......
...@@ -14,6 +14,7 @@ import Utils from '../utils/utils'; ...@@ -14,6 +14,7 @@ import Utils from '../utils/utils';
const factory = new Factory({}); const factory = new Factory({});
// 获取op的输入配置 // 获取op的输入配置
const opConfs = factory.getOpConfs(); const opConfs = factory.getOpConfs();
let opindex = 0;
export default class Graph { export default class Graph {
constructor(options) { constructor(options) {
...@@ -27,12 +28,19 @@ export default class Graph { ...@@ -27,12 +28,19 @@ export default class Graph {
this.feedOp = null; this.feedOp = null;
this.feedItem = null; this.feedItem = null;
this.test = false; this.test = false;
this.formatLayout = 'NCHW';
this.isExecuted = false; this.isExecuted = false;
// 网络层数 // 网络层数
this.iLayer = 0; this.iLayer = 0;
if (this.options && this.options.options && this.options.options.test === true) { if (this.options && this.options.options ) {
this.test = true; if (this.options.options.test === true) {
this.test = true;
}
if (this.options.options.formatLayout) {
this.formatLayout = this.options.options.formatLayout;
}
} }
if (!this.inst) { if (!this.inst) {
...@@ -83,6 +91,9 @@ export default class Graph { ...@@ -83,6 +91,9 @@ export default class Graph {
if (executor.type === 'fetch') { if (executor.type === 'fetch') {
return; return;
} }
opindex++;
// console.log(opindex);
//if (executor.opData) console.log(executor.opData.iLayer);
executor.execute(this.inst, this.isExecuted); executor.execute(this.inst, this.isExecuted);
if (executor.next) { if (executor.next) {
const id = executor.next; const id = executor.next;
...@@ -187,6 +198,106 @@ export default class Graph { ...@@ -187,6 +198,106 @@ export default class Graph {
return item; return item;
}); });
} }
execute_try(temp, ops, idtoindex, executed, inline, prev){
console.log('execute_try!first look at this op');
console.log(ops[temp]);
let canrun = this.checkifcanrun(temp, ops, idtoindex, executed);
if (canrun === false) {
// console.log('canrun === false!');
var a = inline.pop();
this.execute_try(idtoindex[a.id], ops, idtoindex, executed, inline, prev);
return;
}
if (prev >=0) {
ops[prev].next = ops[temp].id;
}
ops[temp].outputsName.forEach(function(item, index) {
executed[item] = true;
})
let next = this.getNextByOp(ops, ops[temp]);
// console.log('this is its next:');
// console.dir(next);
while (next.length === 1) {
let flag = true;
for (let i = 0; i < next[0].inputsName.length; i++){
if (executed[next[0].inputsName[i]] === false) flag = false;
}
if (flag === false) {
// console.log('can not execute next now! jump to another op:');
if (inline.length === 0) return;
prev = temp;
let a = inline.pop();
// console.dir(a);
ops[temp].next = a.id;
temp = idtoindex[a.id];
this.execute_try(temp, ops, idtoindex, executed, inline, prev);
return;
}
else {
// console.log('now execute next op! it is');
ops[temp].next = next[0].id;
temp = idtoindex[next[0].id];
// console.dir(ops[temp]);
next = this.getNextByOp(ops, ops[temp]);
// console.log('its next is: ');
ops[temp].outputsName.forEach(function(item, index) {
executed[item] = true;
})
// console.dir(next);
}
}
if (next.length > 1){
// console.log('next.length > 1!!!');
for (let i = next.length - 1; i >=0 ; i--){
inline.push(next[i]);
}
var a = inline.pop();
this.execute_try(idtoindex[a.id], ops, idtoindex, executed, inline, temp);
}
return;
}
arrangeMap(ops) {
// console.log('arrangeMap!');
// console.dir(ops);
var idtoindex = {};
var executed = {};
var inline = [];
let temp = 0;
// console.log('graph ops:');
// console.dir(ops);
let ops1 = ops;
ops1.forEach(function(item, index) {
idtoindex[item.id] = index;
// console.dir(item);
item.outputsName.forEach(function(i, idx){
executed[i] = false;
})
});
//ops[0].inputsName[0] = {name : "feed"};
// ops[0].outputsName[0] = {name : "image"};
this.execute_try(temp, ops, idtoindex, executed, inline, -1);
return ops;
}
checkifcanrun(temp, ops, executed){
if (!ops[temp].inputsName) return true;
for (let i = 0; i < ops[temp].inputsName.length; i++){
if (executed[ops[temp].inputsName[i]] === false) return false;
}
return true;
}
/** /**
* Get Ops Nets Start Node * Get Ops Nets Start Node
* @param ops * @param ops
...@@ -222,12 +333,23 @@ export default class Graph { ...@@ -222,12 +333,23 @@ export default class Graph {
return item; return item;
}); });
} }
formatWeight(vars) {
if (this.formatLayout === 'NHWC') {
vars.map((item) => {
if (item.data && item.shape) {
item.data = Utils.nhwc2nchw(item.data, item.shape);
}
});
}
};
/** /**
* Create Ops Executor Object Map * Create Ops Executor Object Map
* @param ops * @param ops
* @returns {*} * @returns {*}
*/ */
createOpsMap(ops) { createOpsMap(ops) {
// console.log('ops!!');
// console.dir(ops);
return ops.map((item, idx) => { return ops.map((item, idx) => {
item.idx = idx; item.idx = idx;
const graphExecutor = new GraphExecutor(item); const graphExecutor = new GraphExecutor(item);
...@@ -250,6 +372,17 @@ export default class Graph { ...@@ -250,6 +372,17 @@ export default class Graph {
}); });
} }
getNextByOp(ops, op) {
return ops.filter((item, key) => {
for (let i = 0; i < item.inputsName.length; i++) {
for(let j = 0; j < op.outputsName.length; j++) {
if (item.inputsName[i] === op.outputsName[j]) {
return true;
}
}
}
});
}
/** /**
* dispose * dispose
*/ */
......
module.exports.create = function (args, scope, gl) {
const output = scope[args.outputs.Out[0]]
return {
inferShape() {
output.dim = output.dim.forEach(d => d === -1 ? 1 : d)
},
compute() {
console.log(output)
}
}
}
\ No newline at end of file
module.exports.create = function (args, scope, gl) {
const output = scope[args.outputs.Out[0]]
const input = scope[args.inputs.X[0]]
return {
inferShape() {
output.dim = output.dim.map(d => d === -1 ? 1 : d)
},
compute() {
console.log(input)
console.log(output)
}
}
}
module.exports.create = function (args, scope, gl) {
// const output = scope[args.outputs.Out[0]]
return {
inferShape() {
// output.dim = output.dim.forEach(d => d === -1 ? 1 : d)
},
compute() {
console.log(`${args.type} is going to be implemented`)
}
}
}
\ No newline at end of file
...@@ -47,8 +47,15 @@ export default class Paddle { ...@@ -47,8 +47,15 @@ export default class Paddle {
const graph = new Graph(that.options); const graph = new Graph(that.options);
that.graph = graph; that.graph = graph;
that.graph.data = artifacts.data; that.graph.data = artifacts.data;
that.graph.formatWeight(that.graph.data.vars);
const opsMap = that.graph.createOpsMap(that.graph.data.ops, that.graph.data.vars); const opsMap = that.graph.createOpsMap(that.graph.data.ops, that.graph.data.vars);
that.graph.weightMap = that.graph.constructOpsMap(opsMap); const opsMap1 = that.graph.constructOpsMap(opsMap);
// console.log('opsMap1!');
// console.dir(opsMap1);
const opsMap2 = that.graph.arrangeMap(opsMap1);
// console.log('opsMap2!');
// console.dir(opsMap2);
that.graph.weightMap = opsMap2;
} }
/** /**
* Executes inference for the model for given input tensors. * Executes inference for the model for given input tensors.
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
import Gpu from '../gpu/gpu'; import Gpu from '../gpu/gpu';
import getMaxUniforms from '../test/getMaxUniforms'; import getMaxUniforms from '../test/getMaxUniforms';
import Factory from '../factory/fshader/factory'; import Factory from '../factory/fshader/factory';
import {getTextureShapeInfo} from '../utils/opData'; // import {getTextureShapeInfo} from '../utils/opData';
// 生成factory实例 // 生成factory实例
const factory = new Factory({}); // const factory = new Factory({});
/** /**
* @file gpu运行时 * @file gpu运行时
* @author wangqun@baidu.com, yangmingming@baidu.com * @author wangqun@baidu.com, yangmingming@baidu.com
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
gpu.attachFrameBuffer(opData.iLayer, outTensorId); gpu.attachFrameBuffer(opData.iLayer, outTensorId);
// let end = +Date.now(); // let end = +Date.now();
let bufferStatus = gpu.frameBufferIsComplete(); let bufferStatus = gpu.frameBufferIsComplete();
if (bufferStatus.isComplete) { // if (bufferStatus.isComplete) {
// start = +Date.now(); // start = +Date.now();
// timeObj['buferstatus-time'] = start - end; // timeObj['buferstatus-time'] = start - end;
// gpu.attachShader(opData.fshader); // gpu.attachShader(opData.fshader);
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
// 开始计算,执行 gl.drawArrays // 开始计算,执行 gl.drawArrays
this.gpu.render(opData.renderData, opData.iLayer, isRendered); this.gpu.render(opData.renderData, opData.iLayer, isRendered);
} // }
}); });
}, },
...@@ -86,6 +86,7 @@ export default { ...@@ -86,6 +86,7 @@ export default {
// 其实这里应该有个fetch的执行调用或者fetch的输出 // 其实这里应该有个fetch的执行调用或者fetch的输出
// log.start('后处理-读取数据'); // log.start('后处理-读取数据');
// 开始读数据 // 开始读数据
// window.log.end('执行时间');
return this.gpu.downloadFoat32TensorFromBuffer(pbo); return this.gpu.downloadFoat32TensorFromBuffer(pbo);
}, },
......
...@@ -8,15 +8,15 @@ export default ` ...@@ -8,15 +8,15 @@ export default `
void main(void) { void main(void) {
ivec4 oPos = getOutputTensorPos(); ivec4 oPos = getOutputTensorPos();
// 输出坐标转换为输入坐标 // 输出坐标转换为输入坐标
int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out + oPos.r * channel_out * width_shape_out * height_shape_out; // int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out + oPos.r * channel_out * width_shape_out * height_shape_out;
ivec4 new_oPos = transferFromNHWCtoNCHW(sumVal, channel_out, width_shape_out, height_shape_out, total_shape_out); // ivec4 new_oPos = transferFromNHWCtoNCHW(sumVal, channel_out, width_shape_out, height_shape_out, total_shape_out);
float o = 0.0; float o = 0.0;
if (new_oPos[dim] > inputs_dim[0] - 1) { if (oPos[dim] > inputs_dim[0] - 1) {
new_oPos[dim] = new_oPos[dim] - inputs_dim[0]; oPos[dim] = oPos[dim] - inputs_dim[0];
o = getValueFromTensorPos_counter(new_oPos.r, new_oPos.g, new_oPos.b, new_oPos.a); o = getValueFromTensorPos_counter(oPos.r, oPos.g, oPos.b, oPos.a);
} }
else { else {
o = getValueFromTensorPos_origin(new_oPos.r, new_oPos.g, new_oPos.b, new_oPos.a); o = getValueFromTensorPos_origin(oPos.r, oPos.g, oPos.b, oPos.a);
} }
setOutput(float(o)); setOutput(float(o));
} }
......
...@@ -7,8 +7,8 @@ export default ` ...@@ -7,8 +7,8 @@ export default `
// start函数 // start函数
void main(void) { void main(void) {
ivec4 oPos = getOutputTensorPosLIMIT_OUT(); ivec4 oPos = getOutputTensorPosLIMIT_OUT();
int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out; //int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out;
ivec4 new_oPos = transferFromNHWCtoNCHW(sumVal, channel_out, width_shape_out, height_shape_out, total_shape_out); //ivec4 new_oPos = transferFromNHWCtoNCHW(sumVal, channel_out, width_shape_out, height_shape_out, total_shape_out);
int x = oPos.a; int x = oPos.a;
int c = oPos.g; int c = oPos.g;
int y = oPos.b; int y = oPos.b;
......
...@@ -12,7 +12,12 @@ export default ` ...@@ -12,7 +12,12 @@ export default `
int y = oPos.b; int y = oPos.b;
int b = oPos.r; int b = oPos.r;
float res = 0.0; float res = 0.0;
int temp_x = 0;
int temp_y = 0;
float o = 0.0;
float f = 0.0;
if (x % 2 == 1) x = x - 2;
if (y % 2 == 1) y = y - 2;
// 重排遍历顺序 // 重排遍历顺序
//int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out; //int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out;
//int new_a = sumVal % width_shape_out; //int new_a = sumVal % width_shape_out;
...@@ -22,41 +27,37 @@ export default ` ...@@ -22,41 +27,37 @@ export default `
//int c = new_g; //int c = new_g;
//int y = new_b; //int y = new_b;
// 获取output的坐标 // 获取output的坐标
int oTensorChannel = (c / (channel_out / groups)) * channel_filter; int oTensorChannel = int(c * groups / channel_out) * channel_origin;
int oy = y;
int oy = y * 1 - padTop;
for (int fy = 0; fy < height_shape_filter; fy++) { for (int fy = 0; fy < height_shape_filter; fy++) {
if (oy >= height_shape_origin) {
break;
}
if (oy < 0) { if (oy < 0) {
oy += dilation_v; oy += dilation_v;
continue; continue;
} }
int ox = x * 1 - padLeft; int ox = x;
for (int fx = 0; fx < width_shape_filter; fx++) { for (int fx = 0; fx < width_shape_filter; fx++) {
if (ox >= width_shape_origin) {
break;
}
if (ox < 0) { if (ox < 0) {
ox += dilation_h; ox += dilation_h;
continue; continue;
} }
// channel计算 // channel计算
for (int j = 0; j < channel_filter; j++) { for (int j = 0; j < channel_origin; j++) {
float o = 0.0;
if (ox % stride_h == 0 && oy % stride_v == 0) { if (ox % stride_h == 0 && oy % stride_v == 0) {
int temp_x = int(ox / stride_h); temp_x = int(floor(float(ox) / float(stride_h)));
int temp_y = int(oy / stride_v); temp_y = int(floor(float(oy) / float(stride_v)));
o = getValueFromTensorPosLIMIT_ORIGIN_origin(b, oTensorChannel + j, temp_y, temp_x); if (temp_x < width_shape_origin && temp_y < height_shape_origin){
o = getValueFromTensorPosLIMIT_ORIGIN_origin(b, j, temp_y, temp_x);
f = getValueFromTensorPosLIMIT_FILTER_filter(j, c, fy, fx);
res += f * o;
}
} }
float f = getValueFromTensorPosLIMIT_FILTER_filter(c, j, fy, fx);
res += f * o;
} }
ox += dilation_h; ox += dilation_h;
} }
oy += dilation_v; oy += dilation_v;
} }
setOutput(res); setOutput(float(res));
} }
`; `;
...@@ -28,11 +28,13 @@ export default ` ...@@ -28,11 +28,13 @@ export default `
const int stride_h = int(STRIDES_X); const int stride_h = int(STRIDES_X);
const int stride_v = int(STRIDES_Y); const int stride_v = int(STRIDES_Y);
// padding的数目 // padding的数目
const int padLeft = width_shape_filter - PADDINGS_X - 1; //const int padLeft = width_shape_filter - PADDINGS_X - 1;
const int padTop = height_shape_filter - PADDINGS_Y - 1; //const int padTop = height_shape_filter - PADDINGS_Y - 1;
const int padLeft = PADDINGS_X;
const int padTop = PADDINGS_Y;
// dilation膨胀系数 // dilation膨胀系数
const int dilation_h = DILATION_H; const int dilation_h = DILATIONS_X;
const int dilation_v = DILATION_V; const int dilation_v = DILATIONS_Y;
// groups // groups
const int groups = GROUPS; const int groups = GROUPS;
......
...@@ -8,22 +8,23 @@ export default ` ...@@ -8,22 +8,23 @@ export default `
void main(void) { void main(void) {
// 输出数据 // 输出数据
ivec4 oPos = getOutputTensorPos(); ivec4 oPos = getOutputTensorPos();
int sumVal = oPos.g + oPos.a * channel_origin + oPos.b * channel_origin * width_shape_origin + oPos.r * channel_origin * width_shape_origin * height_shape_origin;
float o = getValueFromTensorPos_origin(oPos.r, oPos.g, oPos.b, oPos.a); float o = getValueFromTensorPos_origin(oPos.r, oPos.g, oPos.b, oPos.a);
ivec4 pos_counter; ivec4 pos_counter;
pos_counter.r = channel_out; float c = 0.0;
pos_counter.g = height_shape_origin;
pos_counter.b = width_shape_origin; if (axis == 1){
pos_counter.a = 1; c = getValueFromTensorPos_counter(0, oPos.r, oPos.g, oPos.b);
int index = 0; }
for (int i = 4 - length_shape_origin + axis; i < 4 - length_shape_origin + axis + length_shape_counter; i++ ){ else if (axis == 2){
if (index > 0) { c = getValueFromTensorPos_counter(0, 0, oPos.r, oPos.g);
index = index * pos_counter[i]; }
} else if (axis == 3){
index += oPos[i]; c = getValueFromTensorPos_counter(0, 0, 0, oPos.r);
} }
float c = getValueFromTensorPos_counter(oPos.r, oPos.g, oPos.b, oPos.a); else {
c = getValueFromTensorPos_counter(oPos.r, oPos.g, oPos.b, oPos.a);
}
float res = c + o; float res = c + o;
setOutput(res); setOutput(float(res));
} }
`; `;
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
export default ` export default `
// start函数 // start函数
void main(void) { void main(void) {
float res = (-1.0 / exp(-20.0)); float res = 0.0;
// 获取output的坐标 // 获取output的坐标
ivec4 out_pos = getOutputTensorPosLIMIT_OUT(); ivec4 out_pos = getOutputTensorPosLIMIT_OUT();
int b = out_pos[0]; int b = out_pos[0];
......
/* eslint-disable */
/**
* @file batchnorm的配置文件
* @author chenhaoze
*/
export default {
dep: [
{
func: 'getValueFromTensorPos',
conf: {
TENSOR_NAME: 'origin'
}
},
{
func: 'transferFromNHWCtoNCHW',
conf:{
}
}
],
conf: [
'WIDTH_SHAPE_ORIGIN',
'HEIGHT_SHAPE_ORIGIN',
'LENGTH_SHAPE_ORIGIN',
'WIDTH_TEXTURE_ORIGIN',
'HEIGHT_TEXTURE_ORIGIN',
'CHANNEL_ORIGIN',
'WIDTH_SHAPE_OUT',
'HEIGHT_SHAPE_OUT',
'WIDTH_TEXTURE_OUT',
'HEIGHT_TEXTURE_OUT',
'CHANNEL_OUT',
'OFFSET_Y_OUT',
'MULTI_VALUE',
'BIAS_VALUE',
'ACTIVE_FUNCTION'
],
input: [
{
tensor: 'origin',
variable: 'texture',
setter: 'initTexture',
type: 'texture'
}
]
};
/* eslint-disable */
/**
* @file reshape主函数
* @author chenhaoze
*/
export default `
// start函数
void main(void) {
// 输出数据
ivec4 oPos = getOutputTensorPos();
// 输出坐标转换为输入坐标
int sumVal = oPos.a + oPos.b * width_shape_out + oPos.g * height_shape_out * width_shape_out + oPos.r * channel_out * width_shape_out * height_shape_out;
ivec4 new_oPos = transferFromNHWCtoNCHW(sumVal, channel_origin, width_shape_origin, height_shape_origin, total_shape_origin);
float o = getValueFromTensorPos_origin(new_oPos.r, new_oPos.g, new_oPos.b, new_oPos.a);
setOutput(float(o));
}
`;
/* eslint-disable */
/**
* @file batchnorm参数文件
* @author chenhaoze
*/
export default `
// 输入数据
const int width_shape_origin = WIDTH_SHAPE_ORIGIN;
const int height_shape_origin = HEIGHT_SHAPE_ORIGIN;
const int length_shape_origin = LENGTH_SHAPE_ORIGIN;
const int width_texture_origin = WIDTH_TEXTURE_ORIGIN;
const int height_texture_origin = HEIGHT_TEXTURE_ORIGIN;
const int channel_origin = CHANNEL_ORIGIN;
const int total_shape_origin = TOTAL_SHAPE_ORIGIN;
// 输入数据
uniform sampler2D texture_origin;
`;
...@@ -9,10 +9,10 @@ void main(void) { ...@@ -9,10 +9,10 @@ void main(void) {
int length = int(target_value.length() / num); int length = int(target_value.length() / num);
ivec4 oPos = getOutputTensorPos(); ivec4 oPos = getOutputTensorPos();
// 输出坐标转换为输入坐标 // 输出坐标转换为输入坐标
int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out + oPos.r * channel_out * width_shape_out * height_shape_out; //int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out + oPos.r * channel_out * width_shape_out * height_shape_out;
ivec4 new_oPos = transferFromNHWCtoNCHW(sumVal, channel_out, width_shape_out, height_shape_out, total_shape_out); //ivec4 new_oPos = transferFromNHWCtoNCHW(sumVal, channel_out, width_shape_out, height_shape_out, total_shape_out);
new_oPos[dim] = new_oPos[dim] + layer_run_time * length; oPos[dim] = oPos[dim] + layer_run_time * length;
float o = getValueFromTensorPos_origin(new_oPos.r, new_oPos.g, new_oPos.b, new_oPos.a); float o = getValueFromTensorPos_origin(oPos.r, oPos.g, oPos.b, oPos.a);
setOutput(float(o)); setOutput(float(o));
} }
`; `;
/* eslint-disable */
/**
* @file batchnorm的配置文件
* @author chenhaoze
*/
export default {
dep: [
{
func: 'getValueFromTensorPos',
conf: {
TENSOR_NAME: 'origin'
}
},
{
func: 'transferFromNHWCtoNCHW',
conf:{
}
}
],
conf: [
'WIDTH_SHAPE_ORIGIN',
'HEIGHT_SHAPE_ORIGIN',
'LENGTH_SHAPE_ORIGIN',
'WIDTH_TEXTURE_ORIGIN',
'HEIGHT_TEXTURE_ORIGIN',
'CHANNEL_ORIGIN',
'WIDTH_SHAPE_OUT',
'HEIGHT_SHAPE_OUT',
'WIDTH_TEXTURE_OUT',
'HEIGHT_TEXTURE_OUT',
'CHANNEL_OUT',
'OFFSET_Y_OUT',
'MULTI_VALUE',
'BIAS_VALUE',
'ACTIVE_FUNCTION'
],
input: [
{
tensor: 'origin',
variable: 'texture',
setter: 'initTexture',
type: 'texture'
}
]
};
/* eslint-disable */
/**
* @file transpose主函数
* @author chenhaoze
*/
export default `
// start函数
void main(void) {
// 输出数据
ivec4 oPos = getOutputTensorPos();
// 重排遍历顺序
//int sumVal = oPos.g + oPos.a * channel_out + oPos.b * channel_out * width_shape_out + oPos.r * channel_out * width_shape_out * height_shape_out;
//ivec4 new_oPos = transferFromNHWCtoNCHW(sumVal, channel_out, width_shape_out, height_shape_out, total_shape_origin);
// 转置 坐标变换
//oPos = new_oPos;
float o = 0.0;
if (perm_size == 1) {
o = getValueFromTensorPos_origin(oPos[0], oPos[1], oPos[2], oPos[3]);
}
else if (perm_size == 2) {
o = getValueFromTensorPos_origin(oPos[0], oPos[1], oPos[min(2 + perm_0, 3)], oPos[min(2 + perm_1, 3)]);
}
else if (perm_size == 3) {
o = getValueFromTensorPos_origin(oPos[0], oPos[min(1 + perm_0, 3)], oPos[min(1 + perm_1, 3)], oPos[min(1 + perm_2, 3)]);
}
else if (perm_size == 4) {
o = getValueFromTensorPos_origin(oPos[perm_0], oPos[perm_1], oPos[perm_2], oPos[perm_3]);
}
setOutput(float(o));
}
`;
/* eslint-disable */
/**
* @file batchnorm参数文件
* @author chenhaoze
*/
export default `
// 输入数据
const int width_shape_origin = WIDTH_SHAPE_ORIGIN;
const int height_shape_origin = HEIGHT_SHAPE_ORIGIN;
const int length_shape_origin = LENGTH_SHAPE_ORIGIN;
const int width_texture_origin = WIDTH_TEXTURE_ORIGIN;
const int height_texture_origin = HEIGHT_TEXTURE_ORIGIN;
const int channel_origin = CHANNEL_ORIGIN;
const int total_shape_origin = TOTAL_SHAPE_ORIGIN;
const int perm_size = PERM_SIZE;
const int perm_0 = PERM_0;
const int perm_1 = PERM_1;
const int perm_2 = PERM_2;
const int perm_3 = PERM_3;
// 输入数据
uniform sampler2D texture_origin;
`;
...@@ -65,8 +65,8 @@ const opBehavior = { ...@@ -65,8 +65,8 @@ const opBehavior = {
'mergeTensor' 'mergeTensor'
], ],
elementwise_add: [ elementwise_add: [
'needBatch', 'processAxis',
'processAxis' 'needBatch'
], ],
conv2d_elementwise_add: [ conv2d_elementwise_add: [
'mergeAttrs', 'mergeAttrs',
...@@ -95,11 +95,14 @@ const opBehavior = { ...@@ -95,11 +95,14 @@ const opBehavior = {
'reshape', 'reshape',
'needBatch' 'needBatch'
], ],
reshape: [ bilinear_interp:[
'needBatch'
],
reshape2: [
'needBatch', 'needBatch',
'inferShape' 'inferShape'
], ],
transpose: [ transpose2: [
'needBatch', 'needBatch',
'setPerm' 'setPerm'
], ],
...@@ -122,6 +125,7 @@ const mergeType = 'conv2d-elementwise_add'; ...@@ -122,6 +125,7 @@ const mergeType = 'conv2d-elementwise_add';
export default class OpData { export default class OpData {
constructor(name, input = {}, output = {}, attrs = {}) { constructor(name, input = {}, output = {}, attrs = {}) {
// console.dir(this);
this.realName = name; this.realName = name;
this.name = name; this.name = name;
this.attrs = attrs; this.attrs = attrs;
...@@ -150,7 +154,7 @@ export default class OpData { ...@@ -150,7 +154,7 @@ export default class OpData {
} }
inferShape(){ inferShape(){
if (this.name == 'reshape'){ if (this.name == 'reshape2'){
let inputShape = this.input.X[0].shape; let inputShape = this.input.X[0].shape;
let targetShape = this.attrs.new_shape; let targetShape = this.attrs.new_shape;
for (let i = 0; i < targetShape.length; i++){ for (let i = 0; i < targetShape.length; i++){
...@@ -201,6 +205,7 @@ export default class OpData { ...@@ -201,6 +205,7 @@ export default class OpData {
// 默认取第一个数据 // 默认取第一个数据
const data = this.output[key] || [{}]; const data = this.output[key] || [{}];
if (tensorName[key.toLowerCase()]) { if (tensorName[key.toLowerCase()]) {
// console.dir(this);
data.forEach(item => { data.forEach(item => {
item.tensorName = tensorName[key.toLowerCase()]; item.tensorName = tensorName[key.toLowerCase()];
tensorData.push(item); tensorData.push(item);
...@@ -276,6 +281,7 @@ export default class OpData { ...@@ -276,6 +281,7 @@ export default class OpData {
this.outputTensors.forEach(outTensor => { this.outputTensors.forEach(outTensor => {
const params = JSON.parse(JSON.stringify(this.data)); const params = JSON.parse(JSON.stringify(this.data));
// 获取output tensor的数据 // 获取output tensor的数据
tensorAttrs.forEach(attr => { tensorAttrs.forEach(attr => {
params[attr+ '_' + outTensor.name] = outTensor[attr]; params[attr+ '_' + outTensor.name] = outTensor[attr];
}); });
...@@ -289,7 +295,7 @@ export default class OpData { ...@@ -289,7 +295,7 @@ export default class OpData {
} }
setPerm(tensorData = []){ setPerm(tensorData = []){
let arrayPerm = this.attrs['perm']; let arrayPerm = this.attrs['axis'];
let l = arrayPerm.length; let l = arrayPerm.length;
if (l == 3) { if (l == 3) {
if (arrayPerm == [2,0,1]) { if (arrayPerm == [2,0,1]) {
...@@ -430,7 +436,15 @@ export default class OpData { ...@@ -430,7 +436,15 @@ export default class OpData {
} }
normalizeDim() { normalizeDim() {
const origin_shape = this.input.X[0].shape; let origin_shape_temp = this.input.X[0].shape;
if (origin_shape_temp.length < 4) {
let batch = [];
for (let i = 0; i < (4 - origin_shape_temp.length); i++) {
batch.push(1);
}
origin_shape_temp = batch.concat(origin_shape_temp);
}
const origin_shape = origin_shape_temp;
const axis = this.attrs.axis > -1 ? this.attrs.axis : origin_shape.length + this.attrs.axis; const axis = this.attrs.axis > -1 ? this.attrs.axis : origin_shape.length + this.attrs.axis;
const dim_value = []; const dim_value = [];
for (let index = 0; index < origin_shape[axis]; index++) { for (let index = 0; index < origin_shape[axis]; index++) {
...@@ -445,19 +459,14 @@ export default class OpData { ...@@ -445,19 +459,14 @@ export default class OpData {
processAxis() { processAxis() {
let shape_x = this.input.X[0].shape; let shape_x = this.input.X[0].shape;
let shape_y = this.input.Y[0].shape; let shape_y = this.input.Y[0].shape;
let y_length = shape_y.length; let axis_temp = this.attrs['axis'];
for (let i = shape_y.length - 1; i >=0 ;i--){ if (axis_temp == -1) {
if (shape_y[i] == 1) { this.attrs['axis'] = shape_x.length - shape_y.length;
y_length -= 1; }
} else {
} this.attrs['axis'] = 4 - shape_y.length - axis_temp;
let axis_temp = this.attrs['axis']; }
if (axis_temp == -1) {
this.attrs['axis'] = shape_x.length - y_length;
}
this.attrs['shape_length_origin'] = shape_x.length;
this.attrs['shape_length_counter'] = y_length;
} }
reshape(tensorData = []) { reshape(tensorData = []) {
......
...@@ -57,13 +57,6 @@ export default class Tensor { ...@@ -57,13 +57,6 @@ export default class Tensor {
} }
this.data = data; this.data = data;
} }
else {
if (opts.data.length > this.total) {
opts.data = opts.data.slice(0, this.total);
}
this.data = new Float32Array(opts.data);
debugger;
}
} else { } else {
// batchnorm的scale // batchnorm的scale
......
...@@ -283,6 +283,29 @@ export default { ...@@ -283,6 +283,29 @@ export default {
numbers.push(i + ": " + data[i]); numbers.push(i + ": " + data[i]);
} }
console.log(numbers) console.log(numbers)
},
softmax(nchwData) {
let result = new Float32Array(nchwData.length);
let maxValue = nchwData[0];
let tempValue = 0.0;
let sumValue = 0.0;
for (let i = 1; i < nchwData.lenght; i++) {
tempValue = nchwData[i];
if (maxValue < tempValue) {
maxValue = tempValue;
}
}
for (let i = 0; i < nchwData.length; i++) {
tempValue = Math.exp(nchwData[i] - maxValue);
result[i] = tempValue;
sumValue = sumValue + tempValue;
}
for (let i = 0; i < nchwData.length; i++) {
result[i] = result[i] / sumValue;
}
return result;
} }
}; };
/* eslint-enable */ /* eslint-enable */
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
10: 'brambling, Fringilla montifringilla',
11: 'goldfinch, Carduelis carduelis',
12: 'house finch, linnet, Carpodacus mexicanus',
13: 'junco, snowbird',
14: 'indigo bunting, indigo finch, indigo bird, Passerina cyanea',
15: 'robin, American robin, Turdus migratorius',
16: 'bulbul',
17: 'jay',
18: 'magpie',
19: 'chickadee',
20: 'water ouzel, dipper',
21: 'kite',
22: 'bald eagle, American eagle, Haliaeetus leucocephalus',
23: 'vulture',
24: 'great grey owl, great gray owl, Strix nebulosa',
25: 'European fire salamander, Salamandra salamandra',
26: 'common newt, Triturus vulgaris',
27: 'eft',
28: 'spotted salamander, Ambystoma maculatum',
29: 'axolotl, mud puppy, Ambystoma mexicanum',
30: 'bullfrog, Rana catesbeiana',
31: 'tree frog, tree-frog',
32: 'tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui',
33: 'loggerhead, loggerhead turtle, Caretta caretta',
34: 'leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea',
35: 'mud turtle',
36: 'terrapin',
37: 'box turtle, box tortoise',
38: 'banded gecko',
39: 'common iguana, iguana, Iguana iguana',
40: 'American chameleon, anole, Anolis carolinensis',
41: 'whiptail, whiptail lizard',
42: 'agama',
43: 'frilled lizard, Chlamydosaurus kingi',
44: 'alligator lizard',
45: 'Gila monster, Heloderma suspectum',
46: 'green lizard, Lacerta viridis',
47: 'African chameleon, Chamaeleo chamaeleon',
48: 'Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis',
49: 'African crocodile, Nile crocodile, Crocodylus niloticus',
50: 'American alligator, Alligator mississipiensis',
51: 'triceratops',
52: 'thunder snake, worm snake, Carphophis amoenus',
53: 'ringneck snake, ring-necked snake, ring snake',
54: 'hognose snake, puff adder, sand viper',
55: 'green snake, grass snake',
56: 'king snake, kingsnake',
57: 'garter snake, grass snake',
58: 'water snake',
59: 'vine snake',
60: 'night snake, Hypsiglena torquata',
61: 'boa constrictor, Constrictor constrictor',
62: 'rock python, rock snake, Python sebae',
63: 'Indian cobra, Naja naja',
64: 'green mamba',
65: 'sea snake',
66: 'horned viper, cerastes, sand viper, horned asp, Cerastes cornutus',
67: 'diamondback, diamondback rattlesnake, Crotalus adamanteus',
68: 'sidewinder, horned rattlesnake, Crotalus cerastes',
69: 'trilobite',
70: 'harvestman, daddy longlegs, Phalangium opilio',
71: 'scorpion',
72: 'black and gold garden spider, Argiope aurantia',
73: 'barn spider, Araneus cavaticus',
74: 'garden spider, Aranea diademata',
75: 'black widow, Latrodectus mactans',
76: 'tarantula',
77: 'wolf spider, hunting spider',
78: 'tick',
79: 'centipede',
80: 'black grouse',
81: 'ptarmigan',
82: 'ruffed grouse, partridge, Bonasa umbellus',
83: 'prairie chicken, prairie grouse, prairie fowl',
84: 'peacock',
85: 'quail',
86: 'partridge',
87: 'African grey, African gray, Psittacus erithacus',
88: 'macaw',
89: 'sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita',
90: 'lorikeet',
91: 'coucal',
92: 'bee eater',
93: 'hornbill',
94: 'hummingbird',
95: 'jacamar',
96: 'toucan',
97: 'drake',
98: 'red-breasted merganser, Mergus serrator',
99: 'goose',
100: 'black swan, Cygnus atratus',
101: 'tusker',
102: 'echidna, spiny anteater, anteater',
103: 'platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus',
104: 'wallaby, brush kangaroo',
105: 'koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus',
106: 'wombat',
107: 'jellyfish',
108: 'sea anemone, anemone',
109: 'brain coral',
110: 'flatworm, platyhelminth',
111: 'nematode, nematode worm, roundworm',
112: 'conch',
113: 'snail',
114: 'slug',
115: 'sea slug, nudibranch',
116: 'chiton, coat-of-mail shell, sea cradle, polyplacophore',
117: 'chambered nautilus, pearly nautilus, nautilus',
118: 'Dungeness crab, Cancer magister',
119: 'rock crab, Cancer irroratus',
120: 'fiddler crab',
121: 'king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica',
122: 'American lobster, Northern lobster, Maine lobster, Homarus americanus',
123: 'spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish',
124: 'crayfish, crawfish, crawdad, crawdaddy',
125: 'hermit crab',
126: 'isopod',
127: 'white stork, Ciconia ciconia',
128: 'black stork, Ciconia nigra',
129: 'spoonbill',
130: 'flamingo',
131: 'little blue heron, Egretta caerulea',
132: 'American egret, great white heron, Egretta albus',
133: 'bittern',
134: 'crane',
135: 'limpkin, Aramus pictus',
136: 'European gallinule, Porphyrio porphyrio',
137: 'American coot, marsh hen, mud hen, water hen, Fulica americana',
138: 'bustard',
139: 'ruddy turnstone, Arenaria interpres',
140: 'red-backed sandpiper, dunlin, Erolia alpina',
141: 'redshank, Tringa totanus',
142: 'dowitcher',
143: 'oystercatcher, oyster catcher',
144: 'pelican',
145: 'king penguin, Aptenodytes patagonica',
146: 'albatross, mollymawk',
147: 'grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus',
148: 'killer whale, killer, orca, grampus, sea wolf, Orcinus orca',
149: 'dugong, Dugong dugon',
150: 'sea lion',
151: 'Chihuahua',
152: 'Japanese spaniel',
153: 'Maltese dog, Maltese terrier, Maltese',
154: 'Pekinese, Pekingese, Peke',
155: 'Shih-Tzu',
156: 'Blenheim spaniel',
157: 'papillon',
158: 'toy terrier',
159: 'Rhodesian ridgeback',
160: 'Afghan hound, Afghan',
161: 'basset, basset hound',
162: 'beagle',
163: 'bloodhound, sleuthhound',
164: 'bluetick',
165: 'black-and-tan coonhound',
166: 'Walker hound, Walker foxhound',
167: 'English foxhound',
168: 'redbone',
169: 'borzoi, Russian wolfhound',
170: 'Irish wolfhound',
171: 'Italian greyhound',
172: 'whippet',
173: 'Ibizan hound, Ibizan Podenco',
174: 'Norwegian elkhound, elkhound',
175: 'otterhound, otter hound',
176: 'Saluki, gazelle hound',
177: 'Scottish deerhound, deerhound',
178: 'Weimaraner',
179: 'Staffordshire bullterrier, Staffordshire bull terrier',
180: 'American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier',
181: 'Bedlington terrier',
182: 'Border terrier',
183: 'Kerry blue terrier',
184: 'Irish terrier',
185: 'Norfolk terrier',
186: 'Norwich terrier',
187: 'Yorkshire terrier',
188: 'wire-haired fox terrier',
189: 'Lakeland terrier',
190: 'Sealyham terrier, Sealyham',
191: 'Airedale, Airedale terrier',
192: 'cairn, cairn terrier',
193: 'Australian terrier',
194: 'Dandie Dinmont, Dandie Dinmont terrier',
195: 'Boston bull, Boston terrier',
196: 'miniature schnauzer',
197: 'giant schnauzer',
198: 'standard schnauzer',
199: 'Scotch terrier, Scottish terrier, Scottie',
200: 'Tibetan terrier, chrysanthemum dog',
201: 'silky terrier, Sydney silky',
202: 'soft-coated wheaten terrier',
203: 'West Highland white terrier',
204: 'Lhasa, Lhasa apso',
205: 'flat-coated retriever',
206: 'curly-coated retriever',
207: 'golden retriever',
208: 'Labrador retriever',
209: 'Chesapeake Bay retriever',
210: 'German short-haired pointer',
211: 'vizsla, Hungarian pointer',
212: 'English setter',
213: 'Irish setter, red setter',
214: 'Gordon setter',
215: 'Brittany spaniel',
216: 'clumber, clumber spaniel',
217: 'English springer, English springer spaniel',
218: 'Welsh springer spaniel',
219: 'cocker spaniel, English cocker spaniel, cocker',
220: 'Sussex spaniel',
221: 'Irish water spaniel',
222: 'kuvasz',
223: 'schipperke',
224: 'groenendael',
225: 'malinois',
226: 'briard',
227: 'kelpie',
228: 'komondor',
229: 'Old English sheepdog, bobtail',
230: 'Shetland sheepdog, Shetland sheep dog, Shetland',
231: 'collie',
232: 'Border collie',
233: 'Bouvier des Flandres, Bouviers des Flandres',
234: 'Rottweiler',
235: 'German shepherd, German shepherd dog, German police dog, alsatian',
236: 'Doberman, Doberman pinscher',
237: 'miniature pinscher',
238: 'Greater Swiss Mountain dog',
239: 'Bernese mountain dog',
240: 'Appenzeller',
241: 'EntleBucher',
242: 'boxer',
243: 'bull mastiff',
244: 'Tibetan mastiff',
245: 'French bulldog',
246: 'Great Dane',
247: 'Saint Bernard, St Bernard',
248: 'Eskimo dog, husky',
249: 'malamute, malemute, Alaskan malamute',
250: 'Siberian husky',
251: 'dalmatian, coach dog, carriage dog',
252: 'affenpinscher, monkey pinscher, monkey dog',
253: 'basenji',
254: 'pug, pug-dog',
255: 'Leonberg',
256: 'Newfoundland, Newfoundland dog',
257: 'Great Pyrenees',
258: 'Samoyed, Samoyede',
259: 'Pomeranian',
260: 'chow, chow chow',
261: 'keeshond',
262: 'Brabancon griffon',
263: 'Pembroke, Pembroke Welsh corgi',
264: 'Cardigan, Cardigan Welsh corgi',
265: 'toy poodle',
266: 'miniature poodle',
267: 'standard poodle',
268: 'Mexican hairless',
269: 'timber wolf, grey wolf, gray wolf, Canis lupus',
270: 'white wolf, Arctic wolf, Canis lupus tundrarum',
271: 'red wolf, maned wolf, Canis rufus, Canis niger',
272: 'coyote, prairie wolf, brush wolf, Canis latrans',
273: 'dingo, warrigal, warragal, Canis dingo',
274: 'dhole, Cuon alpinus',
275: 'African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus',
276: 'hyena, hyaena',
277: 'red fox, Vulpes vulpes',
278: 'kit fox, Vulpes macrotis',
279: 'Arctic fox, white fox, Alopex lagopus',
280: 'grey fox, gray fox, Urocyon cinereoargenteus',
281: 'tabby, tabby cat',
282: 'tiger cat',
283: 'Persian cat',
284: 'Siamese cat, Siamese',
285: 'Egyptian cat',
286: 'cougar, puma, catamount, mountain lion, painter, panther, Felis concolor',
287: 'lynx, catamount',
288: 'leopard, Panthera pardus',
289: 'snow leopard, ounce, Panthera uncia',
290: 'jaguar, panther, Panthera onca, Felis onca',
291: 'lion, king of beasts, Panthera leo',
292: 'tiger, Panthera tigris',
293: 'cheetah, chetah, Acinonyx jubatus',
294: 'brown bear, bruin, Ursus arctos',
295: 'American black bear, black bear, Ursus americanus, Euarctos americanus',
296: 'ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus',
297: 'sloth bear, Melursus ursinus, Ursus ursinus',
298: 'mongoose',
299: 'meerkat, mierkat',
300: 'tiger beetle',
301: 'ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle',
302: 'ground beetle, carabid beetle',
303: 'long-horned beetle, longicorn, longicorn beetle',
304: 'leaf beetle, chrysomelid',
305: 'dung beetle',
306: 'rhinoceros beetle',
307: 'weevil',
308: 'fly',
309: 'bee',
310: 'ant, emmet, pismire',
311: 'grasshopper, hopper',
312: 'cricket',
313: 'walking stick, walkingstick, stick insect',
314: 'cockroach, roach',
315: 'mantis, mantid',
316: 'cicada, cicala',
317: 'leafhopper',
318: 'lacewing, lacewing fly',
319: "dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk",
320: 'damselfly',
321: 'admiral',
322: 'ringlet, ringlet butterfly',
323: 'monarch, monarch butterfly, milkweed butterfly, Danaus plexippus',
324: 'cabbage butterfly',
325: 'sulphur butterfly, sulfur butterfly',
326: 'lycaenid, lycaenid butterfly',
327: 'starfish, sea star',
328: 'sea urchin',
329: 'sea cucumber, holothurian',
330: 'wood rabbit, cottontail, cottontail rabbit',
331: 'hare',
332: 'Angora, Angora rabbit',
333: 'hamster',
334: 'porcupine, hedgehog',
335: 'fox squirrel, eastern fox squirrel, Sciurus niger',
336: 'marmot',
337: 'beaver',
338: 'guinea pig, Cavia cobaya',
339: 'sorrel',
340: 'zebra',
341: 'hog, pig, grunter, squealer, Sus scrofa',
342: 'wild boar, boar, Sus scrofa',
343: 'warthog',
344: 'hippopotamus, hippo, river horse, Hippopotamus amphibius',
345: 'ox',
346: 'water buffalo, water ox, Asiatic buffalo, Bubalus bubalis',
347: 'bison',
348: 'ram, tup',
349: 'bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis',
350: 'ibex, Capra ibex',
351: 'hartebeest',
352: 'impala, Aepyceros melampus',
353: 'gazelle',
354: 'Arabian camel, dromedary, Camelus dromedarius',
355: 'llama',
356: 'weasel',
357: 'mink',
358: 'polecat, fitch, foulmart, foumart, Mustela putorius',
359: 'black-footed ferret, ferret, Mustela nigripes',
360: 'otter',
361: 'skunk, polecat, wood pussy',
362: 'badger',
363: 'armadillo',
364: 'three-toed sloth, ai, Bradypus tridactylus',
365: 'orangutan, orang, orangutang, Pongo pygmaeus',
366: 'gorilla, Gorilla gorilla',
367: 'chimpanzee, chimp, Pan troglodytes',
368: 'gibbon, Hylobates lar',
369: 'siamang, Hylobates syndactylus, Symphalangus syndactylus',
370: 'guenon, guenon monkey',
371: 'patas, hussar monkey, Erythrocebus patas',
372: 'baboon',
373: 'macaque',
374: 'langur',
375: 'colobus, colobus monkey',
376: 'proboscis monkey, Nasalis larvatus',
377: 'marmoset',
378: 'capuchin, ringtail, Cebus capucinus',
379: 'howler monkey, howler',
380: 'titi, titi monkey',
381: 'spider monkey, Ateles geoffroyi',
382: 'squirrel monkey, Saimiri sciureus',
383: 'Madagascar cat, ring-tailed lemur, Lemur catta',
384: 'indri, indris, Indri indri, Indri brevicaudatus',
385: 'Indian elephant, Elephas maximus',
386: 'African elephant, Loxodonta africana',
387: 'lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens',
388: 'giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca',
389: 'barracouta, snoek',
390: 'eel',
391: 'coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch',
392: 'rock beauty, Holocanthus tricolor',
393: 'anemone fish',
394: 'sturgeon',
395: 'gar, garfish, garpike, billfish, Lepisosteus osseus',
396: 'lionfish',
397: 'puffer, pufferfish, blowfish, globefish',
398: 'abacus',
399: 'abaya',
400: "academic gown, academic robe, judge's robe",
401: 'accordion, piano accordion, squeeze box',
402: 'acoustic guitar',
403: 'aircraft carrier, carrier, flattop, attack aircraft carrier',
404: 'airliner',
405: 'airship, dirigible',
406: 'altar',
407: 'ambulance',
408: 'amphibian, amphibious vehicle',
409: 'analog clock',
410: 'apiary, bee house',
411: 'apron',
412: 'ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin',
413: 'assault rifle, assault gun',
414: 'backpack, back pack, knapsack, packsack, rucksack, haversack',
415: 'bakery, bakeshop, bakehouse',
416: 'balance beam, beam',
417: 'balloon',
418: 'ballpoint, ballpoint pen, ballpen, Biro',
419: 'Band Aid',
420: 'banjo',
421: 'bannister, banister, balustrade, balusters, handrail',
422: 'barbell',
423: 'barber chair',
424: 'barbershop',
425: 'barn',
426: 'barometer',
427: 'barrel, cask',
428: 'barrow, garden cart, lawn cart, wheelbarrow',
429: 'baseball',
430: 'basketball',
431: 'bassinet',
432: 'bassoon',
433: 'bathing cap, swimming cap',
434: 'bath towel',
435: 'bathtub, bathing tub, bath, tub',
436: 'beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon',
437: 'beacon, lighthouse, beacon light, pharos',
438: 'beaker',
439: 'bearskin, busby, shako',
440: 'beer bottle',
441: 'beer glass',
442: 'bell cote, bell cot',
443: 'bib',
444: 'bicycle-built-for-two, tandem bicycle, tandem',
445: 'bikini, two-piece',
446: 'binder, ring-binder',
447: 'binoculars, field glasses, opera glasses',
448: 'birdhouse',
449: 'boathouse',
450: 'bobsled, bobsleigh, bob',
451: 'bolo tie, bolo, bola tie, bola',
452: 'bonnet, poke bonnet',
453: 'bookcase',
454: 'bookshop, bookstore, bookstall',
455: 'bottlecap',
456: 'bow',
457: 'bow tie, bow-tie, bowtie',
458: 'brass, memorial tablet, plaque',
459: 'brassiere, bra, bandeau',
460: 'breakwater, groin, groyne, mole, bulwark, seawall, jetty',
461: 'breastplate, aegis, egis',
462: 'broom',
463: 'bucket, pail',
464: 'buckle',
465: 'bulletproof vest',
466: 'bullet train, bullet',
467: 'butcher shop, meat market',
468: 'cab, hack, taxi, taxicab',
469: 'caldron, cauldron',
470: 'candle, taper, wax light',
471: 'cannon',
472: 'canoe',
473: 'can opener, tin opener',
474: 'cardigan',
475: 'car mirror',
476: 'carousel, carrousel, merry-go-round, roundabout, whirligig',
477: "carpenter's kit, tool kit",
478: 'carton',
479: 'car wheel',
480: 'cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM',
481: 'cassette',
482: 'cassette player',
483: 'castle',
484: 'catamaran',
485: 'CD player',
486: 'cello, violoncello',
487: 'cellular telephone, cellular phone, cellphone, cell, mobile phone',
488: 'chain',
489: 'chainlink fence',
490: 'chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour',
491: 'chain saw, chainsaw',
492: 'chest',
493: 'chiffonier, commode',
494: 'chime, bell, gong',
495: 'china cabinet, china closet',
496: 'Christmas stocking',
497: 'church, church building',
498: 'cinema, movie theater, movie theatre, movie house, picture palace',
499: 'cleaver, meat cleaver, chopper',
500: 'cliff dwelling',
501: 'cloak',
502: 'clog, geta, patten, sabot',
503: 'cocktail shaker',
504: 'coffee mug',
505: 'coffeepot',
506: 'coil, spiral, volute, whorl, helix',
507: 'combination lock',
508: 'computer keyboard, keypad',
509: 'confectionery, confectionary, candy store',
510: 'container ship, containership, container vessel',
511: 'convertible',
512: 'corkscrew, bottle screw',
513: 'cornet, horn, trumpet, trump',
514: 'cowboy boot',
515: 'cowboy hat, ten-gallon hat',
516: 'cradle',
517: 'crane',
518: 'crash helmet',
519: 'crate',
520: 'crib, cot',
521: 'Crock Pot',
522: 'croquet ball',
523: 'crutch',
524: 'cuirass',
525: 'dam, dike, dyke',
526: 'desk',
527: 'desktop computer',
528: 'dial telephone, dial phone',
529: 'diaper, nappy, napkin',
530: 'digital clock',
531: 'digital watch',
532: 'dining table, board',
533: 'dishrag, dishcloth',
534: 'dishwasher, dish washer, dishwashing machine',
535: 'disk brake, disc brake',
536: 'dock, dockage, docking facility',
537: 'dogsled, dog sled, dog sleigh',
538: 'dome',
539: 'doormat, welcome mat',
540: 'drilling platform, offshore rig',
541: 'drum, membranophone, tympan',
542: 'drumstick',
543: 'dumbbell',
544: 'Dutch oven',
545: 'electric fan, blower',
546: 'electric guitar',
547: 'electric locomotive',
548: 'entertainment center',
549: 'envelope',
550: 'espresso maker',
551: 'face powder',
552: 'feather boa, boa',
553: 'file, file cabinet, filing cabinet',
554: 'fireboat',
555: 'fire engine, fire truck',
556: 'fire screen, fireguard',
557: 'flagpole, flagstaff',
558: 'flute, transverse flute',
559: 'folding chair',
560: 'football helmet',
561: 'forklift',
562: 'fountain',
563: 'fountain pen',
564: 'four-poster',
565: 'freight car',
566: 'French horn, horn',
567: 'frying pan, frypan, skillet',
568: 'fur coat',
569: 'garbage truck, dustcart',
570: 'gasmask, respirator, gas helmet',
571: 'gas pump, gasoline pump, petrol pump, island dispenser',
572: 'goblet',
573: 'go-kart',
574: 'golf ball',
575: 'golfcart, golf cart',
576: 'gondola',
577: 'gong, tam-tam',
578: 'gown',
579: 'grand piano, grand',
580: 'greenhouse, nursery, glasshouse',
581: 'grille, radiator grille',
582: 'grocery store, grocery, food market, market',
583: 'guillotine',
584: 'hair slide',
585: 'hair spray',
586: 'half track',
587: 'hammer',
588: 'hamper',
589: 'hand blower, blow dryer, blow drier, hair dryer, hair drier',
590: 'hand-held computer, hand-held microcomputer',
591: 'handkerchief, hankie, hanky, hankey',
592: 'hard disc, hard disk, fixed disk',
593: 'harmonica, mouth organ, harp, mouth harp',
594: 'harp',
595: 'harvester, reaper',
596: 'hatchet',
597: 'holster',
598: 'home theater, home theatre',
599: 'honeycomb',
600: 'hook, claw',
601: 'hoopskirt, crinoline',
602: 'horizontal bar, high bar',
603: 'horse cart, horse-cart',
604: 'hourglass',
605: 'iPod',
606: 'iron, smoothing iron',
607: "jack-o'-lantern",
608: 'jean, blue jean, denim',
609: 'jeep, landrover',
610: 'jersey, T-shirt, tee shirt',
611: 'jigsaw puzzle',
612: 'jinrikisha, ricksha, rickshaw',
613: 'joystick',
614: 'kimono',
615: 'knee pad',
616: 'knot',
617: 'lab coat, laboratory coat',
618: 'ladle',
619: 'lampshade, lamp shade',
620: 'laptop, laptop computer',
621: 'lawn mower, mower',
622: 'lens cap, lens cover',
623: 'letter opener, paper knife, paperknife',
624: 'library',
625: 'lifeboat',
626: 'lighter, light, igniter, ignitor',
627: 'limousine, limo',
628: 'liner, ocean liner',
629: 'lipstick, lip rouge',
630: 'Loafer',
631: 'lotion',
632: 'loudspeaker, speaker, speaker unit, loudspeaker system, speaker system',
633: "loupe, jeweler's loupe",
634: 'lumbermill, sawmill',
635: 'magnetic compass',
636: 'mailbag, postbag',
637: 'mailbox, letter box',
638: 'maillot',
639: 'maillot, tank suit',
640: 'manhole cover',
641: 'maraca',
642: 'marimba, xylophone',
643: 'mask',
644: 'matchstick',
645: 'maypole',
646: 'maze, labyrinth',
647: 'measuring cup',
648: 'medicine chest, medicine cabinet',
649: 'megalith, megalithic structure',
650: 'microphone, mike',
651: 'microwave, microwave oven',
652: 'military uniform',
653: 'milk can',
654: 'minibus',
655: 'miniskirt, mini',
656: 'minivan',
657: 'missile',
658: 'mitten',
659: 'mixing bowl',
660: 'mobile home, manufactured home',
661: 'Model T',
662: 'modem',
663: 'monastery',
664: 'monitor',
665: 'moped',
666: 'mortar',
667: 'mortarboard',
668: 'mosque',
669: 'mosquito net',
670: 'motor scooter, scooter',
671: 'mountain bike, all-terrain bike, off-roader',
672: 'mountain tent',
673: 'mouse, computer mouse',
674: 'mousetrap',
675: 'moving van',
676: 'muzzle',
677: 'nail',
678: 'neck brace',
679: 'necklace',
680: 'nipple',
681: 'notebook, notebook computer',
682: 'obelisk',
683: 'oboe, hautboy, hautbois',
684: 'ocarina, sweet potato',
685: 'odometer, hodometer, mileometer, milometer',
686: 'oil filter',
687: 'organ, pipe organ',
688: 'oscilloscope, scope, cathode-ray oscilloscope, CRO',
689: 'overskirt',
690: 'oxcart',
691: 'oxygen mask',
692: 'packet',
693: 'paddle, boat paddle',
694: 'paddlewheel, paddle wheel',
695: 'padlock',
696: 'paintbrush',
697: "pajama, pyjama, pj's, jammies",
698: 'palace',
699: 'panpipe, pandean pipe, syrinx',
700: 'paper towel',
701: 'parachute, chute',
702: 'parallel bars, bars',
703: 'park bench',
704: 'parking meter',
705: 'passenger car, coach, carriage',
706: 'patio, terrace',
707: 'pay-phone, pay-station',
708: 'pedestal, plinth, footstall',
709: 'pencil box, pencil case',
710: 'pencil sharpener',
711: 'perfume, essence',
712: 'Petri dish',
713: 'photocopier',
714: 'pick, plectrum, plectron',
715: 'pickelhaube',
716: 'picket fence, paling',
717: 'pickup, pickup truck',
718: 'pier',
719: 'piggy bank, penny bank',
720: 'pill bottle',
721: 'pillow',
722: 'ping-pong ball',
723: 'pinwheel',
724: 'pirate, pirate ship',
725: 'pitcher, ewer',
726: "plane, carpenter's plane, woodworking plane",
727: 'planetarium',
728: 'plastic bag',
729: 'plate rack',
730: 'plow, plough',
731: "plunger, plumber's helper",
732: 'Polaroid camera, Polaroid Land camera',
733: 'pole',
734: 'police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria',
735: 'poncho',
736: 'pool table, billiard table, snooker table',
737: 'pop bottle, soda bottle',
738: 'pot, flowerpot',
739: "potter's wheel",
740: 'power drill',
741: 'prayer rug, prayer mat',
742: 'printer',
743: 'prison, prison house',
744: 'projectile, missile',
745: 'projector',
746: 'puck, hockey puck',
747: 'punching bag, punch bag, punching ball, punchball',
748: 'purse',
749: 'quill, quill pen',
750: 'quilt, comforter, comfort, puff',
751: 'racer, race car, racing car',
752: 'racket, racquet',
753: 'radiator',
754: 'radio, wireless',
755: 'radio telescope, radio reflector',
756: 'rain barrel',
757: 'recreational vehicle, RV, R.V.',
758: 'reel',
759: 'reflex camera',
760: 'refrigerator, icebox',
761: 'remote control, remote',
762: 'restaurant, eating house, eating place, eatery',
763: 'revolver, six-gun, six-shooter',
764: 'rifle',
765: 'rocking chair, rocker',
766: 'rotisserie',
767: 'rubber eraser, rubber, pencil eraser',
768: 'rugby ball',
769: 'rule, ruler',
770: 'running shoe',
771: 'safe',
772: 'safety pin',
773: 'saltshaker, salt shaker',
774: 'sandal',
775: 'sarong',
776: 'sax, saxophone',
777: 'scabbard',
778: 'scale, weighing machine',
779: 'school bus',
780: 'schooner',
781: 'scoreboard',
782: 'screen, CRT screen',
783: 'screw',
784: 'screwdriver',
785: 'seat belt, seatbelt',
786: 'sewing machine',
787: 'shield, buckler',
788: 'shoe shop, shoe-shop, shoe store',
789: 'shoji',
790: 'shopping basket',
791: 'shopping cart',
792: 'shovel',
793: 'shower cap',
794: 'shower curtain',
795: 'ski',
796: 'ski mask',
797: 'sleeping bag',
798: 'slide rule, slipstick',
799: 'sliding door',
800: 'slot, one-armed bandit',
801: 'snorkel',
802: 'snowmobile',
803: 'snowplow, snowplough',
804: 'soap dispenser',
805: 'soccer ball',
806: 'sock',
807: 'solar dish, solar collector, solar furnace',
808: 'sombrero',
809: 'soup bowl',
810: 'space bar',
811: 'space heater',
812: 'space shuttle',
813: 'spatula',
814: 'speedboat',
815: "spider web, spider's web",
816: 'spindle',
817: 'sports car, sport car',
818: 'spotlight, spot',
819: 'stage',
820: 'steam locomotive',
821: 'steel arch bridge',
822: 'steel drum',
823: 'stethoscope',
824: 'stole',
825: 'stone wall',
826: 'stopwatch, stop watch',
827: 'stove',
828: 'strainer',
829: 'streetcar, tram, tramcar, trolley, trolley car',
830: 'stretcher',
831: 'studio couch, day bed',
832: 'stupa, tope',
833: 'submarine, pigboat, sub, U-boat',
834: 'suit, suit of clothes',
835: 'sundial',
836: 'sunglass',
837: 'sunglasses, dark glasses, shades',
838: 'sunscreen, sunblock, sun blocker',
839: 'suspension bridge',
840: 'swab, swob, mop',
841: 'sweatshirt',
842: 'swimming trunks, bathing trunks',
843: 'swing',
844: 'switch, electric switch, electrical switch',
845: 'syringe',
846: 'table lamp',
847: 'tank, army tank, armored combat vehicle, armoured combat vehicle',
848: 'tape player',
849: 'teapot',
850: 'teddy, teddy bear',
851: 'television, television system',
852: 'tennis ball',
853: 'thatch, thatched roof',
854: 'theater curtain, theatre curtain',
855: 'thimble',
856: 'thresher, thrasher, threshing machine',
857: 'throne',
858: 'tile roof',
859: 'toaster',
860: 'tobacco shop, tobacconist shop, tobacconist',
861: 'toilet seat',
862: 'torch',
863: 'totem pole',
864: 'tow truck, tow car, wrecker',
865: 'toyshop',
866: 'tractor',
867: 'trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi',
868: 'tray',
869: 'trench coat',
870: 'tricycle, trike, velocipede',
871: 'trimaran',
872: 'tripod',
873: 'triumphal arch',
874: 'trolleybus, trolley coach, trackless trolley',
875: 'trombone',
876: 'tub, vat',
877: 'turnstile',
878: 'typewriter keyboard',
879: 'umbrella',
880: 'unicycle, monocycle',
881: 'upright, upright piano',
882: 'vacuum, vacuum cleaner',
883: 'vase',
884: 'vault',
885: 'velvet',
886: 'vending machine',
887: 'vestment',
888: 'viaduct',
889: 'violin, fiddle',
890: 'volleyball',
891: 'waffle iron',
892: 'wall clock',
893: 'wallet, billfold, notecase, pocketbook',
894: 'wardrobe, closet, press',
895: 'warplane, military plane',
896: 'washbasin, handbasin, washbowl, lavabo, wash-hand basin',
897: 'washer, automatic washer, washing machine',
898: 'water bottle',
899: 'water jug',
900: 'water tower',
901: 'whiskey jug',
902: 'whistle',
903: 'wig',
904: 'window screen',
905: 'window shade',
906: 'Windsor tie',
907: 'wine bottle',
908: 'wing',
909: 'wok',
910: 'wooden spoon',
911: 'wool, woolen, woollen',
912: 'worm fence, snake fence, snake-rail fence, Virginia fence',
913: 'wreck',
914: 'yawl',
915: 'yurt',
916: 'web site, website, internet site, site',
917: 'comic book',
918: 'crossword puzzle, crossword',
919: 'street sign',
920: 'traffic light, traffic signal, stoplight',
921: 'book jacket, dust cover, dust jacket, dust wrapper',
922: 'menu',
923: 'plate',
924: 'guacamole',
925: 'consomme',
926: 'hot pot, hotpot',
927: 'trifle',
928: 'ice cream, icecream',
929: 'ice lolly, lolly, lollipop, popsicle',
930: 'French loaf',
931: 'bagel, beigel',
932: 'pretzel',
933: 'cheeseburger',
934: 'hotdog, hot dog, red hot',
935: 'mashed potato',
936: 'head cabbage',
937: 'broccoli',
938: 'cauliflower',
939: 'zucchini, courgette',
940: 'spaghetti squash',
941: 'acorn squash',
942: 'butternut squash',
943: 'cucumber, cuke',
944: 'artichoke, globe artichoke',
945: 'bell pepper',
946: 'cardoon',
947: 'mushroom',
948: 'Granny Smith',
949: 'strawberry',
950: 'orange',
951: 'lemon',
952: 'fig',
953: 'pineapple, ananas',
954: 'banana',
955: 'jackfruit, jak, jack',
956: 'custard apple',
957: 'pomegranate',
958: 'hay',
959: 'carbonara',
960: 'chocolate sauce, chocolate syrup',
961: 'dough',
962: 'meat loaf, meatloaf',
963: 'pizza, pizza pie',
964: 'potpie',
965: 'burrito',
966: 'red wine',
967: 'espresso',
968: 'cup',
969: 'eggnog',
970: 'alp',
971: 'bubble',
972: 'cliff, drop, drop-off',
973: 'coral reef',
974: 'geyser',
975: 'lakeside, lakeshore',
976: 'promontory, headland, head, foreland',
977: 'sandbar, sand bar',
978: 'seashore, coast, seacoast, sea-coast',
979: 'valley, vale',
980: 'volcano',
981: 'ballplayer, baseball player',
982: 'groom, bridegroom',
983: 'scuba diver',
984: 'rapeseed',
985: 'daisy',
986: "yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum",
987: 'corn',
988: 'acorn',
989: 'hip, rose hip, rosehip',
990: 'buckeye, horse chestnut, conker',
991: 'coral fungus',
992: 'agaric',
993: 'gyromitra',
994: 'stinkhorn, carrion fungus',
995: 'earthstar',
996: 'hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa',
997: 'bolete',
998: 'ear, spike, capitulum',
999: 'toilet tissue, toilet paper, bathroom tissue'}
因为 它太大了无法显示 source diff 。你可以改为 查看blob
{
"ops": [
{
"attrs": {
"axis": -1
},
"inputs": {
"X": ["concat.tmp_0"],
"Y": ["concat.tmp_1"]
},
"outputs": {
"Out": ["concat.tmp_2"]
},
"type": "concat"
}
],
"vars": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8],
"name": "concat.tmp_0",
"shape": [2, 2, 2]
},
{
"data": [11, 12, 13, 14],
"name": "concat.tmp_1",
"shape": [2, 2, 1]
},
{
"data": [1, 2, 11, 3, 4, 12, 5, 6, 13, 7, 8, 14],
"name": "concat.tmp_2",
"shape": [2, 2, 3]
}
]
}
{
"ops": [
{
"attrs": {
"Scale_in": 1.0,
"Scale_in_eltwise": 1.0,
"Scale_out": 1.0,
"Scale_weights": [
1.0
],
"data_format": "AnyLayout",
"dilations": [
1,
1
],
"exhaustive_search": false,
"force_fp32_output": false,
"fuse_relu": false,
"fuse_relu_before_depthwise_conv": false,
"fuse_residual_connection": false,
"groups": 2,
"is_test": 1,
"paddings": [
0,
0
],
"strides": [
1,
1
],
"use_cudnn": true,
"use_mkldnn": false,
"workspace_size_MB": 4096
},
"inputs": {
"Filter": [
"conv2d_0.w_0"
],
"Input": [
"pixel"
]
},
"outputs": {
"Output": [
"conv2d_0.tmp_0"
]
},
"type": "conv2d"
}
],
"vars": [
{
"data": [
0, 1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1, 0,
0, 2, 0, 2, 0, 2, 0, 2, 0,
0, 2, 0, 2, 0, 2, 0, 2, 0,
0, 2, 0, 2, 0, 2, 0, 2, 0,
0, 2, 0, 2, 0, 2, 0, 2, 0
],
"name": "pixel",
"persistable": 0,
"shape": [
1,
8,
3,
3
]
},
{
"data": [
0, 1, 0, 1,
0, 1, 0, 1,
0, 1, 0, 1,
0, 1, 0, 1,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2,
0, 2, 0, 2
],
"name": "conv2d_0.w_0",
"persistable": 1,
"shape": [
4,
4,
2,
2
]
},
{
"data": [
],
"name": "conv2d_1.b_0",
"persistable": 1,
"shape": [
50
]
},
{
"data": [
4, 4, 4, 4,
8, 8, 8, 8,
16, 16, 16, 16,
16, 16, 16, 16
],
"name": "conv2d_0.tmp_0",
"persistable": 0,
"shape": [
1,
4,
2,
2
]
},
]
}
因为 它太大了无法显示 source diff 。你可以改为 查看blob
{
"ops": [
{
"attrs": {
"axis": 1,
"use_mkldnn": false,
"x_data_format": "",
"y_data_format": ""
},
"inputs": {
"X": [
"fc_0.tmp_0"
],
"Y": [
"fc7_offset"
]
},
"outputs": {
"Out": [
"fc_0.tmp_1"
]
},
"type": "elementwise_add"
}
],
"vars": [
{
"data": [
0, 1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 1, 0, 1, 0,
0, 2, 0, 2, 0, 2, 0, 2, 0,
0, 2, 0, 2, 0, 2, 0, 2, 0,
0, 2, 0, 2, 0, 2, 0, 2, 0,
0, 2, 0, 2, 0, 2, 0, 2, 0
],
"name": "pixel",
"persistable": 0,
"shape": [
1,
8,
3,
3
]
},
{
"data": [
-1.1098297834396362,
6.280017375946045,
3.1823835372924805,
1.9810107946395874,
0.03745591640472412,
2.6181418895721436,
2.867142915725708,
2.11924409866333,
-0.6121698617935181,
-4.319775581359863,
-5.5695600509643555,
-3.0855345726013184,
0.2046980857849121,
-2.9285874366760254,
-4.034234046936035,
-0.3219590187072754,
-3.8337182998657227,
-3.458463668823242,
-1.8676337003707886,
-2.8824174404144287,
-3.224912166595459,
2.8730430603027344,
1.17366361618042,
0.7122759819030762,
-2.003032922744751,
-0.08305394649505615,
1.0322399139404297,
-0.13402244448661804,
-1.4503525495529175,
0.9064493179321289,
1.312484860420227,
-0.5213003158569336,
2.973198890686035,
2.2515311241149902,
4.331067085266113,
0.39521080255508423,
-0.024464011192321777,
-2.817532777786255,
-1.181924819946289,
-1.9536917209625244,
-1.3022257089614868,
-3.0054824352264404,
1.0263299942016602,
2.1801626682281494,
-2.5572702884674072,
-1.9350857734680176,
-1.5212739706039429,
-3.0372211933135986,
-3.9655723571777344,
-3.16747784614563,
0.9443843960762024,
-2.5688347816467285,
-3.845409631729126,
-3.5706634521484375,
0.07929372787475586,
-1.7236900329589844,
-2.5290720462799072,
-2.59753155708313,
-1.938873529434204,
0.13098883628845215,
0.8310225009918213,
-4.163984775543213,
-2.2919321060180664,
-2.2529170513153076,
-0.32626527547836304,
-1.6464781761169434,
-0.8053542971611023,
-0.43675923347473145,
-1.8472626209259033,
-1.5393996238708496,
-1.3766282796859741,
-2.5448594093322754,
-1.8978112936019897,
2.9039812088012695,
1.774146318435669,
-0.513042688369751,
1.1454157829284668,
1.4261561632156372,
1.5273460149765015,
-0.7735292911529541,
1.6160634756088257,
0.7888234853744507,
1.1879230737686157,
-0.7824995517730713,
-4.992694854736328,
-1.5696773529052734,
-0.7463071346282959,
-2.967804431915283,
-1.9331011772155762,
-4.363243579864502,
-1.9011057615280151,
-3.65684175491333,
-4.679007530212402,
-2.854567527770996,
-0.7942641377449036,
-4.447449684143066,
-1.8494857549667358,
-0.6775758266448975,
-3.124417543411255,
-1.0919077396392822,
-1.204681634902954,
2.697819471359253,
-4.28972864151001,
-1.4630482196807861,
-1.6940839290618896,
-4.467775821685791,
1.658867359161377,
5.264161109924316,
-0.23039180040359497,
-2.0056653022766113,
2.4297993183135986,
3.8325250148773193,
6.236888408660889,
1.081353783607483,
0.9114763140678406,
3.819485902786255,
-0.8213856220245361,
2.6917107105255127,
3.1594784259796143,
3.2505340576171875,
-1.599015474319458,
5.865414619445801,
3.3848185539245605,
1.0470486879348755,
1.7181504964828491,
5.232596397399902,
2.4393012523651123,
-0.6650027632713318,
-2.698718547821045,
-3.7027933597564697,
-1.0648775100708008,
-4.57002592086792,
-1.3015716075897217,
-4.141479969024658,
-3.543605327606201,
0.11356914043426514,
-4.142419815063477,
-3.0896196365356445,
-5.248664379119873,
-1.0557355880737305,
-5.700218677520752,
-3.210575819015503,
-6.002849578857422,
-1.5150558948516846,
0.7668859958648682,
2.0850210189819336,
-1.9190276861190796,
7.063694953918457,
2.1589503288269043,
-2.5693466663360596,
-0.41036903858184814,
0.27354103326797485,
-4.041271686553955,
-1.8141188621520996,
-0.9877132773399353,
-1.400024175643921,
-2.7775607109069824,
-2.2304954528808594,
-3.7750062942504883,
-2.6431808471679688,
-1.1961359977722168,
-0.8919503688812256,
-2.6909024715423584,
-0.6629705429077148,
-1.7510700225830078,
-0.8857673406600952,
-3.2500250339508057,
-2.1082746982574463,
0.2042170763015747,
-2.210299253463745,
0.7864104509353638,
-2.9751083850860596,
-2.2737724781036377,
-0.68779057264328,
-0.9036482572555542,
-0.7623353600502014,
-3.5691213607788086,
-0.9564109444618225,
-1.3931095600128174,
-2.2496964931488037,
-3.593845844268799,
-2.067422866821289,
-0.5507739782333374,
2.6511547565460205,
3.190521717071533,
-0.4711952805519104,
-0.44052132964134216,
0.020955059677362442,
2.9489078521728516,
0.2345447540283203,
-1.57606041431427,
2.722463369369507,
-1.085034966468811,
-2.1278340816497803,
-4.472021102905273,
-0.15057799220085144,
1.023224949836731,
0.1553490161895752,
-0.8380561470985413,
2.7073187828063965,
-1.1645872592926025,
-1.3870041370391846,
-0.19245240092277527,
1.5917038917541504,
-1.8875302076339722,
-2.0529909133911133,
-2.716744899749756,
0.7809892892837524,
-2.2398364543914795,
-1.214713454246521,
-3.069598913192749,
0.19325768947601318,
2.2853477001190186,
3.8020496368408203,
0.9614565968513489,
0.25733819603919983,
-2.749157667160034,
0.5181249380111694,
-0.05282244086265564,
2.6641454696655273,
0.4792838394641876,
-0.8193203806877136,
-1.7853703498840332,
1.2008960247039795,
2.9270849227905273,
-3.4362072944641113,
-0.9281041622161865,
-2.711972713470459,
-0.30203473567962646,
-1.243424892425537,
0.21164435148239136,
0.25878894329071045,
-0.3724523186683655,
1.21412193775177,
-0.8826887607574463,
-0.25927621126174927,
-1.2882156372070312,
-0.7579304575920105,
-2.3151230812072754,
-1.9493675231933594,
1.0950922966003418,
-0.9096841812133789,
-0.6080835461616516,
-4.516273021697998,
-2.077496290206909,
-0.13329768180847168,
-2.554391860961914,
-0.882907509803772,
-1.4816160202026367,
-0.8138746023178101,
0.4209463894367218,
2.1191864013671875,
-0.5152456760406494,
-1.3701984882354736,
-1.842582106590271,
-3.198296070098877,
-0.5327607989311218,
-2.23941707611084,
2.802278518676758,
1.1445939540863037,
-0.10909640789031982,
-2.1707987785339355,
-0.6605309844017029,
-1.702032208442688,
-1.3742380142211914,
0.30779576301574707,
-1.527796745300293,
2.5908055305480957,
-5.370712757110596,
3.1592442989349365,
1.8471250534057617,
1.4450740814208984,
-0.29365819692611694,
2.8080296516418457,
0.7826064229011536,
2.24487566947937,
3.8284924030303955,
2.0590174198150635,
-3.0601096153259277,
-0.38943415880203247,
-0.9199885129928589,
-2.6166539192199707,
-3.7082812786102295,
1.6603496074676514,
-1.9530476331710815,
-2.1296348571777344,
1.4963228702545166,
-1.9633915424346924,
0.9424124956130981,
-2.3196699619293213,
-0.8016772270202637,
2.1566343307495117,
-4.999898910522461,
0.11684525012969971,
6.941814422607422,
2.546445608139038,
3.173893451690674,
0.08999282121658325,
-0.12652826309204102,
0.8835113048553467,
-6.410438060760498,
1.4145431518554688,
0.6318698525428772,
-1.1987061500549316,
-0.07767903804779053,
-4.531796455383301,
-0.8173074126243591,
-1.51220703125,
0.49932414293289185,
3.565516471862793,
2.5288636684417725,
-1.4967541694641113,
-1.2811284065246582,
2.1081948280334473,
-1.1358236074447632,
0.49249017238616943,
-2.2904512882232666,
-1.4134225845336914,
0.013357375748455524,
0.6631985902786255,
0.8505830764770508,
1.5555975437164307,
-2.922717332839966,
-0.4823005199432373,
-1.6811696290969849,
-2.7099595069885254,
-4.608072280883789,
6.704110622406006,
2.128044366836548,
4.943448066711426,
-2.8732614517211914,
0.35023045539855957,
-2.2871432304382324,
-0.41411900520324707,
-3.4737284183502197,
0.8822903633117676,
2.4548470973968506,
0.2483443021774292,
-3.75382137298584,
4.36890983581543,
-1.286186933517456,
-1.3454530239105225,
-2.3936538696289062,
-2.380206823348999,
-0.6745333671569824,
1.6055960655212402,
-4.198836803436279,
5.09708309173584,
-1.8996615409851074,
-2.6783154010772705,
2.8310494422912598,
-1.8546035289764404,
-3.533179759979248,
-5.79323148727417,
4.695282459259033,
0.7224174737930298,
-1.5337331295013428,
-2.323596715927124,
-2.1259078979492188,
-1.7988808155059814,
-0.7696970701217651,
-1.3165106773376465,
-3.482513904571533,
-1.9235535860061646,
-3.8766250610351562,
2.8696720600128174,
-1.4360194206237793,
-0.8234670758247375,
-5.143311500549316,
-4.450238227844238,
-3.2954797744750977,
-2.9979262351989746,
0.6171916723251343,
-0.00595325231552124,
0.6727069616317749,
-4.503152370452881,
-2.3362483978271484,
-0.9406384229660034,
-0.6121606826782227,
-2.160066843032837,
0.6046799421310425,
0.2239534854888916,
-1.9791312217712402,
-5.341414451599121,
-0.08803188800811768,
1.6064965724945068,
0.20806407928466797,
-0.8675591945648193,
-4.5164008140563965,
3.120645046234131,
1.309441089630127,
-1.250939130783081,
-0.5207388997077942,
-0.7241864800453186,
-0.25348925590515137,
0.2392439842224121,
0.544073224067688,
-0.37482893466949463,
-1.4554963111877441,
0.3761484622955322,
1.5785998106002808,
0.834793210029602,
1.4881293773651123,
0.8964934349060059,
1.2715522050857544,
3.930844783782959,
1.4107838869094849,
2.465442180633545,
-3.588897228240967,
3.716876745223999,
-0.22951894998550415,
-4.336287021636963,
-0.7980577349662781,
-1.0871174335479736,
-2.829066276550293,
-1.2431702613830566,
-2.1182312965393066,
5.274393558502197,
2.6847620010375977,
-0.17691034078598022,
2.0382988452911377,
4.685642719268799,
-1.648077368736267,
-6.088254451751709,
-2.4805350303649902,
5.693214416503906,
2.1471195220947266,
2.6805875301361084,
-1.257446527481079,
-1.9631949663162231,
-4.690670967102051,
-0.9372278451919556,
3.6071414947509766,
1.5920652151107788,
-0.5450392365455627,
1.9293763637542725,
-3.0089166164398193,
8.61243724822998,
0.8929249048233032,
1.8419400453567505,
2.788212776184082,
3.637413263320923,
5.870749473571777,
-5.372323036193848,
-0.24803829193115234,
0.10370641946792603,
-3.5142319202423096,
4.495314121246338,
2.1045520305633545,
2.0311503410339355,
-5.7489423751831055,
0.6904568076133728,
-0.2398514747619629,
-1.1769464015960693,
-2.284090995788574,
-0.25422826409339905,
-0.18415647745132446,
1.0443592071533203,
0.6887814402580261,
-0.009091198444366455,
4.3580169677734375,
-0.14628857374191284,
-2.0272841453552246,
0.4465930759906769,
1.2870067358016968,
-2.3178417682647705,
-1.5118120908737183,
-0.33232688903808594,
1.9783192873001099,
6.8699846267700195,
6.672363758087158,
5.466246604919434,
1.4994380474090576,
-5.813544273376465,
-1.6810972690582275,
5.7172627449035645,
4.691410064697266,
-6.627619743347168,
-4.731492042541504,
-3.009411334991455,
-0.7301946878433228,
-3.7846250534057617,
-4.3645524978637695,
3.143440008163452,
-1.224428653717041,
-1.9145143032073975,
-0.1480833888053894,
-2.4886786937713623,
5.607964515686035,
3.4411098957061768,
1.11717689037323,
1.888771653175354,
-0.7449076175689697,
-2.2770392894744873,
4.673813819885254,
-3.319258689880371,
1.4409315586090088,
4.926970958709717,
5.2587361335754395,
-1.0249165296554565,
-1.9151029586791992,
3.3469390869140625,
-5.655460834503174,
-0.9310908317565918,
1.889914870262146,
1.7415921688079834,
2.792124032974243,
-2.2904415130615234,
-0.35307103395462036,
-7.687912464141846,
3.3800578117370605,
-1.0004303455352783,
-0.538013756275177,
5.968576431274414,
-1.8725266456604004,
4.414268493652344,
-1.3398373126983643,
5.847112655639648,
-0.8823839426040649,
-3.061614513397217,
-4.172097682952881,
0.5199050903320312,
-2.83974552154541,
1.7894599437713623,
-0.3212776482105255,
1.9916589260101318,
-3.59755539894104,
-0.05543780326843262,
-4.00023889541626,
-4.610026836395264,
3.1512610912323,
0.3296220302581787,
-4.829360485076904,
-3.8058745861053467,
-2.9025802612304688,
-4.724573135375977,
2.7765512466430664,
-0.8614257574081421,
4.6350016593933105,
-3.192822217941284,
8.156087875366211,
2.1967530250549316,
1.4798681735992432,
-0.2139655351638794,
2.5098695755004883,
-0.9141243100166321,
0.8962705731391907,
-5.281251430511475,
-5.2019758224487305,
0.36304938793182373,
-2.2317490577697754,
-4.200922966003418,
3.646543264389038,
-1.4773303270339966,
5.693246364593506,
6.649788856506348,
9.594747543334961,
8.084684371948242,
4.109189033508301,
-1.1514382362365723,
-3.79378342628479,
-3.480154037475586,
10.20333480834961,
2.9916653633117676,
-4.7623443603515625,
-2.815553903579712,
3.1256189346313477,
-0.17683625221252441,
1.4069968461990356,
0.15567752718925476,
4.422062397003174,
-0.13792681694030762,
-0.13611863553524017,
-4.004006862640381,
-0.7330857515335083,
0.2794785499572754,
1.2011271715164185,
1.155246376991272,
4.6407623291015625,
-1.1888951063156128,
4.365846633911133,
-0.6002482771873474,
-3.0060014724731445,
0.6116334199905396,
-0.7408015131950378,
1.695010781288147,
0.935187578201294,
0.6442794799804688,
-3.2748143672943115,
-2.0293121337890625,
-5.253023624420166,
0.3686100244522095,
-4.746075630187988,
0.7276730537414551,
-0.5353613495826721,
1.609863042831421,
0.22987711429595947,
-3.051483631134033,
-2.196925163269043,
2.5409834384918213,
2.590078115463257,
2.8073747158050537,
-0.28132355213165283,
-3.6353588104248047,
3.98014235496521,
-2.2295749187469482,
-2.7915709018707275,
8.170427322387695,
-1.0024746656417847,
2.566547393798828,
0.06248068809509277,
-0.7986176013946533,
-4.506911754608154,
-2.927586555480957,
-0.12328934669494629,
-3.035170078277588,
4.570350646972656,
-0.9428645372390747,
0.2511644959449768,
7.779752731323242,
2.5547313690185547,
-3.305330276489258,
3.045858860015869,
-0.4476429522037506,
-2.0454654693603516,
-0.903998851776123,
4.6712188720703125,
0.27812618017196655,
5.7286057472229,
0.5027726888656616,
-3.1397976875305176,
-2.410263776779175,
0.7584738731384277,
-0.09872323274612427,
-1.150364875793457,
-1.4736695289611816,
-4.299774169921875,
0.017202258110046387,
2.481471061706543,
-0.31894949078559875,
-4.897672653198242,
0.9074056148529053,
0.812396764755249,
2.7788052558898926,
6.849625587463379,
5.36129093170166,
4.017366886138916,
-3.183743953704834,
-0.5459802150726318,
3.2476983070373535,
3.6680338382720947,
1.4542344808578491,
0.735497236251831,
-1.1498156785964966,
-2.0790834426879883,
0.16575568914413452,
-0.03247302770614624,
6.315743446350098,
0.924880862236023,
-2.996906280517578,
2.4611358642578125,
-3.311616897583008,
-3.387801170349121,
0.8263566493988037,
2.1338391304016113,
0.4939492642879486,
0.8877021074295044,
1.1741135120391846,
2.520150661468506,
0.24434268474578857,
-0.21956467628479004,
1.3664960861206055,
4.209738731384277,
-2.212778329849243,
-2.8679332733154297,
-3.226949691772461,
-1.7605046033859253,
2.150820016860962,
-0.9418412446975708,
0.37490323185920715,
0.8136546611785889,
-0.11969602108001709,
5.994228839874268,
4.868772029876709,
-0.013888329267501831,
-0.030041515827178955,
-4.1262617111206055,
-1.131576657295227,
-0.29804515838623047,
1.016602873802185,
-2.378706932067871,
-0.5206512212753296,
-2.7961068153381348,
2.4040234088897705,
2.989335060119629,
-0.5807543992996216,
-0.8712574243545532,
-2.622992515563965,
2.751124858856201,
2.263490676879883,
0.004918038845062256,
4.510312557220459,
0.1265907883644104,
2.1885972023010254,
1.1275163888931274,
-1.1744939088821411,
-1.9860807657241821,
-2.6154427528381348,
2.6831283569335938,
-5.057710647583008,
-2.955465793609619,
3.8433141708374023,
0.37156692147254944,
-0.9450574517250061,
0.5926560163497925,
1.3082735538482666,
7.855043411254883,
-1.4003933668136597,
6.306633472442627,
-0.4289991855621338,
-2.9058985710144043,
-2.930300235748291,
-3.4064619541168213,
-0.6290552616119385,
2.236776828765869,
-0.5510813593864441,
-5.766793727874756,
4.212404251098633,
1.1983050107955933,
-6.177562236785889,
-0.21780884265899658,
5.1457014083862305,
-3.8856449127197266,
5.100142478942871,
-1.179671049118042,
1.9967836141586304,
-1.6635756492614746,
2.04691743850708,
1.2857341766357422,
-0.9254895448684692,
-1.8866302967071533,
-2.21700119972229,
-2.081390142440796,
-0.5563896894454956,
5.322556018829346,
3.021404266357422,
-4.315042972564697,
-0.7041801810264587,
-5.1402740478515625,
0.4352649450302124,
-1.2055838108062744,
-0.915346622467041,
-4.0407562255859375,
-0.260110467672348,
-2.177421808242798,
8.112772941589355,
-0.8848628997802734,
1.0522022247314453,
0.43089449405670166,
0.016312897205352783,
0.11614853143692017,
-0.970054030418396,
2.685154914855957,
4.828297138214111,
3.130793571472168,
-3.9669342041015625,
6.695780277252197,
-1.3808481693267822,
-0.301638126373291,
-1.1256015300750732,
-1.3600900173187256,
-2.324624538421631,
2.2629315853118896,
0.5607572793960571,
-5.157692909240723,
3.9711337089538574,
6.691866874694824,
-2.4260101318359375,
-1.418802261352539,
0.4121089577674866,
4.471992492675781,
0.9565921425819397,
2.776496410369873,
2.192915916442871,
1.3897244930267334,
2.5141682624816895,
-0.05197015404701233,
0.06691209971904755,
-5.464636325836182,
-2.1806037425994873,
-6.835583686828613,
-2.281047821044922,
0.77875816822052,
-1.253766417503357,
0.9833312034606934,
3.8752336502075195,
4.124049663543701,
-0.8178051710128784,
-3.7768311500549316,
-2.536095380783081,
-5.925909042358398,
4.3578410148620605,
4.045070648193359,
1.4647364616394043,
-3.2888472080230713,
2.4718637466430664,
-2.6735756397247314,
2.3179798126220703,
0.4816662073135376,
-1.835519790649414,
-2.349308490753174,
1.4841803312301636,
8.026285171508789,
1.0783554315567017,
0.7481228113174438,
2.799593210220337,
-3.5019006729125977,
-0.878243088722229,
5.556700706481934,
5.841644287109375,
-0.8360974788665771,
4.000271797180176,
2.1913576126098633,
-2.534567356109619,
4.1587934494018555,
-1.4160758256912231,
2.1097140312194824,
4.607666969299316,
1.5096783638000488,
-1.2303180694580078,
-4.263491153717041,
-2.718886375427246,
5.722687721252441,
-0.5992395877838135,
2.4602646827697754,
0.32089829444885254,
3.0749223232269287,
2.154711961746216,
1.0471856594085693,
6.153417587280273,
-1.0595678091049194,
-0.8727691173553467,
1.8015199899673462,
0.8221091628074646,
-1.4698102474212646,
-0.8753116130828857,
3.660459518432617,
1.7487772703170776,
-4.510850429534912,
1.0301592350006104,
1.6128931045532227,
0.6620266437530518,
1.428957462310791,
-0.8467459678649902,
2.08194637298584,
-1.0377404689788818,
-0.8258668184280396,
-1.931388020515442,
0.07245266437530518,
3.392714738845825,
-2.9453344345092773,
-1.9955157041549683,
15.100059509277344,
-0.8732953071594238,
1.9544179439544678,
-3.4860191345214844,
2.509908676147461,
3.5911426544189453,
-2.4688429832458496,
0.247595876455307,
0.7223533391952515,
0.6755980253219604,
4.797938346862793,
2.8082027435302734,
-4.613275051116943,
5.547893524169922,
3.452322244644165,
-1.9822416305541992,
-3.2672886848449707,
2.8431692123413086,
3.9009008407592773,
-2.3796653747558594,
-3.2589194774627686,
1.6440908908843994,
2.7890090942382812,
0.004936039447784424,
-3.948458433151245,
-0.13766270875930786,
2.2167553901672363,
0.6457685232162476,
-3.3130836486816406,
-4.4620842933654785,
-1.9370622634887695,
-4.617079734802246,
-6.038240909576416,
1.54433012008667,
-0.09978294372558594,
-2.07271671295166,
3.6365294456481934,
1.2165300846099854,
6.736310005187988,
-0.18252074718475342,
3.483471632003784,
2.921428918838501,
5.8854570388793945,
0.9763119220733643,
-2.0435452461242676,
1.5152926445007324,
7.39365816116333,
3.9875752925872803,
0.22976088523864746,
0.17124438285827637,
3.20837140083313,
2.285531997680664,
-2.976733684539795,
2.699382781982422,
-0.7666529417037964,
0.43301108479499817,
0.16560816764831543,
3.5898046493530273,
7.006841659545898,
-0.12547287344932556,
0.5199018120765686,
-0.11101913452148438,
-2.995083808898926,
-0.888218879699707,
-1.3327231407165527,
-3.944938898086548,
-1.4718095064163208,
2.740164041519165,
-2.3250980377197266,
-5.957701683044434,
1.1843727827072144,
-3.0477213859558105,
-1.6871494054794312,
-1.3469650745391846,
-1.4783258438110352,
-0.056777626276016235,
-0.17500090599060059,
-3.129871368408203,
0.3952667713165283,
3.8376286029815674,
2.0914740562438965,
-0.17175006866455078,
-4.356967449188232,
3.0029993057250977,
-2.175262928009033,
0.5232577323913574,
-0.9669685959815979,
0.48462820053100586,
2.615009307861328,
0.39842450618743896,
3.2784276008605957,
-0.7935425043106079,
-0.8281271457672119,
-5.32557487487793,
-3.431715488433838,
2.657937526702881,
1.8374935388565063,
-1.3508665561676025,
1.165624737739563,
-0.7844128608703613,
-3.8114514350891113,
-2.442646026611328,
-1.308203101158142,
-0.1618315577507019,
3.670588970184326,
-1.6248745918273926,
2.7459731101989746,
-0.6265474557876587,
8.495512008666992,
4.642634391784668,
4.539473056793213,
0.5902433395385742,
9.182209014892578,
5.103418827056885,
4.956284046173096,
2.566216468811035,
4.942897796630859,
3.6660542488098145,
23.049583435058594,
-2.7657229900360107,
3.5249435901641846,
1.7531436681747437,
1.537284255027771,
-0.08369851112365723,
0.965727686882019,
1.0605276823043823,
2.5457205772399902,
3.432680130004883,
4.784576416015625,
-4.050437927246094,
-2.3392884731292725,
-1.146059274673462,
1.710395336151123,
0.8851326704025269,
-4.536794662475586,
-2.2027015686035156,
2.881460428237915,
0.0770329087972641
],
"name": "fc_0.tmp_0",
"shape": [
1000
]
},
{
"data": [
-0.003687990130856633,
0.008941259235143661,
-0.042509354650974274,
-0.07615242153406143,
0.0016824366757646203,
0.030000973492860794,
-0.05920300632715225,
0.007062121760100126,
0.010919729247689247,
-0.005986877251416445,
-0.027077991515398026,
-0.03718835487961769,
-0.04542677477002144,
-0.03190528228878975,
-0.03503408282995224,
-0.02900092490017414,
-0.01618349924683571,
-0.04425717145204544,
0.022584278136491776,
-0.029175972566008568,
0.007222338113933802,
0.07700718194246292,
0.03663356229662895,
0.03943665325641632,
0.018214982002973557,
-0.006235828157514334,
0.03991832956671715,
-0.009165618568658829,
0.052990756928920746,
0.027237508445978165,
0.004488788545131683,
0.004633789882063866,
0.0016598375514149666,
-0.029173247516155243,
-0.030307913199067116,
-0.09201760590076447,
0.01796901598572731,
-0.02547488361597061,
0.037831202149391174,
-0.025843188166618347,
-0.0007046036189422011,
0.014085481874644756,
0.042991623282432556,
-0.028124360367655754,
0.0057566845789551735,
0.00628122640773654,
0.018652061000466347,
0.01148306205868721,
-0.034914530813694,
0.012302433140575886,
0.009908963926136494,
-0.03329543396830559,
0.014409501105546951,
0.06615757942199707,
0.048445116728544235,
-0.032974425703287125,
-0.012695248238742352,
0.009905386716127396,
0.029218202456831932,
0.04958366975188255,
-0.038969654589891434,
0.044527195394039154,
0.011119761504232883,
0.042752981185913086,
0.045461833477020264,
0.02014610916376114,
-0.042606718838214874,
-0.043032560497522354,
0.028376195579767227,
0.03386761248111725,
-0.036220550537109375,
0.010016041807830334,
0.009949347004294395,
0.04470713436603546,
-0.051252298057079315,
0.0767943486571312,
0.0041234842501580715,
0.036432620137929916,
0.03746800497174263,
0.049837492406368256,
-0.016233598813414574,
0.004503053147345781,
0.047307197004556656,
-0.07187791168689728,
-0.04691136255860329,
0.01753365993499756,
-0.045829590409994125,
0.03300822526216507,
0.013956207782030106,
0.05863100290298462,
-0.022346297279000282,
-0.01606469787657261,
0.023254569619894028,
-0.01878412440419197,
0.0038996823132038116,
-0.04281593859195709,
0.03302016854286194,
-0.0386907197535038,
-0.07114642858505249,
-0.041318245232105255,
-0.04032706469297409,
-0.04344240576028824,
0.014916200190782547,
0.03272692859172821,
0.07935557514429092,
-0.008555051870644093,
-0.009787137620151043,
-0.0306097399443388,
-0.08618611097335815,
-0.07458283752202988,
-0.075184166431427,
0.11888779699802399,
-0.004389737732708454,
-0.032326407730579376,
0.021167520433664322,
-0.10738597810268402,
-0.02206539548933506,
-0.012461562640964985,
-0.029862049967050552,
-0.02732396312057972,
-0.006496133748441935,
-0.06019638106226921,
0.011636381037533283,
-0.03529941290616989,
-0.024814391508698463,
-0.0558750219643116,
-0.04255114123225212,
-0.008036980405449867,
-0.0013836845755577087,
-0.008182249031960964,
-0.07602342218160629,
-0.017665550112724304,
-0.03154440596699715,
0.03391769528388977,
-0.06318379193544388,
-0.09120860695838928,
-0.009102470241487026,
-0.04334781691431999,
-0.03436822071671486,
-0.057156793773174286,
-0.026569120585918427,
-0.049035243690013885,
-0.07681417465209961,
-0.007682671770453453,
-0.06119278818368912,
-0.013299357146024704,
0.027436597272753716,
-0.10607337951660156,
-0.04855261370539665,
-0.01895856484770775,
-0.03375741094350815,
0.02278212644159794,
-0.07413793355226517,
0.044130343943834305,
-0.042438071221113205,
0.030345484614372253,
0.016346510499715805,
-0.022047536447644234,
-0.0268916767090559,
0.023788440972566605,
0.0037406908813863993,
0.07911145687103271,
0.10528411716222763,
0.028225675225257874,
0.03214694559574127,
-0.036065131425857544,
0.0065807499922811985,
-0.04256792366504669,
0.0017863328102976084,
0.04745251312851906,
0.04024731367826462,
0.07360631227493286,
0.00813769269734621,
-0.0032228557392954826,
0.09753743559122086,
-0.03156182914972305,
-0.015077676624059677,
-0.015156712383031845,
0.057017698884010315,
-0.030488548800349236,
0.01436206977814436,
0.021209977567195892,
0.050788190215826035,
-0.04890962317585945,
0.03269631788134575,
0.03792430832982063,
0.00979586411267519,
0.0075846584513783455,
-0.0013552780728787184,
0.04568997025489807,
0.014611033722758293,
0.03396603837609291,
0.036835771054029465,
-0.015292062424123287,
-0.006450719200074673,
0.09010869264602661,
0.01520546805113554,
0.05093624070286751,
-0.007369194179773331,
0.05408911034464836,
-0.07000315189361572,
-0.01344625186175108,
0.01375866774469614,
0.05445721000432968,
0.08905062079429626,
-0.00881881918758154,
-0.05341064929962158,
-0.03651686757802963,
-0.016954468563199043,
0.07111198455095291,
-0.006579005159437656,
0.043587543070316315,
0.0061905719339847565,
-0.05055670812726021,
-0.010135982185602188,
-0.029468845576047897,
-0.0005263779894448817,
0.11087743937969208,
0.056521639227867126,
0.03685186058282852,
0.003410185454413295,
-0.04220917075872421,
-0.060174569487571716,
0.11088450253009796,
-0.069431833922863,
0.04977741837501526,
0.026545176282525063,
0.011630460619926453,
-0.07659721374511719,
0.06973671168088913,
0.01941361278295517,
-0.011653874069452286,
0.03184152767062187,
0.028282474726438522,
0.028816957026720047,
-0.009142627008259296,
0.08147864043712616,
0.05270121991634369,
0.03915988653898239,
0.07278130203485489,
0.005851069465279579,
-0.019348109140992165,
0.028488166630268097,
-0.004942269530147314,
-0.00551163824275136,
0.10196322947740555,
-0.053148940205574036,
0.03904684633016586,
-0.01270862203091383,
-0.007544093765318394,
-0.007785910274833441,
0.025109879672527313,
-0.039188750088214874,
-0.02362559735774994,
0.01791459508240223,
0.012472287751734257,
-0.024860121309757233,
0.04719432815909386,
0.00444876030087471,
0.028805160894989967,
0.027503645047545433,
0.02371162176132202,
-0.01892799884080887,
0.0607261024415493,
-0.015286020003259182,
0.009634957648813725,
0.03645457327365875,
-0.0011025714920833707,
-0.05426860973238945,
-0.01658141426742077,
0.0731697604060173,
-0.05162889510393143,
0.004718414507806301,
-0.0245496928691864,
-0.028555067256093025,
-0.047821901738643646,
0.01644270494580269,
-0.03812135383486748,
-0.013669120147824287,
0.024389216676354408,
-0.012269080616533756,
0.09645938873291016,
-0.06203361600637436,
-0.026839524507522583,
0.08298112452030182,
0.03540303185582161,
0.010105741210281849,
-0.0029790534172207117,
-0.03672816976904869,
-0.026661334559321404,
-0.036529384553432465,
-0.03294587880373001,
-0.04116649180650711,
-0.03697272390127182,
-0.029658380895853043,
0.011680827476084232,
-0.04510074108839035,
-0.004310951568186283,
0.008505568839609623,
0.022901875898241997,
-0.029224766418337822,
-0.018233710899949074,
0.0029424179811030626,
-0.04292156919836998,
-0.06061087176203728,
0.029131216928362846,
0.025320354849100113,
-0.051130231469869614,
-0.036364343017339706,
-0.03604738041758537,
-0.018819935619831085,
-0.02530958689749241,
0.037919577211141586,
0.03258763253688812,
0.028257347643375397,
0.039612989872694016,
-0.041416067630052567,
-0.021830370649695396,
0.04463235288858414,
0.007241268642246723,
-0.042530711740255356,
-0.06662322580814362,
-0.06920646131038666,
-0.05042976886034012,
-0.03885788470506668,
-0.02979196049273014,
-0.05639709159731865,
-0.03180181607604027,
-0.00023263058392331004,
-0.04037349298596382,
-0.011919450014829636,
-0.04540950059890747,
0.017394384369254112,
0.05616847798228264,
-0.017490621656179428,
-0.01792430691421032,
0.038348469883203506,
-0.0448252335190773,
-0.006676798220723867,
0.01121603325009346,
-0.01954822801053524,
-0.024139299988746643,
-0.008223014883697033,
-0.06968462467193604,
-0.03202514722943306,
0.00808144174516201,
0.0738309919834137,
0.00757223553955555,
0.0350271537899971,
-0.069671630859375,
0.018206359818577766,
-0.017576169222593307,
-0.05238618329167366,
0.0021791569888591766,
0.021363601088523865,
-0.0041518486104905605,
0.02223283238708973,
-0.023093393072485924,
-0.00603022426366806,
0.08376206457614899,
-0.01123447623103857,
0.01212579570710659,
-0.0034400124568492174,
0.011145046912133694,
0.03473440185189247,
0.00573844276368618,
-0.003223319770768285,
0.030685516074299812,
-0.03471050783991814,
0.022468747571110725,
-0.00850107241421938,
-0.039500683546066284,
-0.0366390161216259,
0.009813347831368446,
-0.056138601154088974,
-0.063619464635849,
0.021581145003437996,
-0.03223695605993271,
0.05089665204286575,
0.044291429221630096,
-0.022422200068831444,
-0.03323088213801384,
0.003001729492098093,
-0.00490409042686224,
-0.07070058584213257,
-0.03231103718280792,
-0.015496424399316311,
-0.026021216064691544,
-0.04688943549990654,
-0.034998681396245956,
-0.03197839483618736,
0.02240949310362339,
-0.06649056822061539,
-0.07519687712192535,
-0.026499437168240547,
-0.034499913454055786,
-0.08717647939920425,
-0.04213351011276245,
-0.0034737081732600927,
0.027897685766220093,
0.01174659188836813,
0.05360700562596321,
0.008449586108326912,
-0.025189554318785667,
-0.08118382841348648,
0.06983719766139984,
-0.029494380578398705,
-0.0221935473382473,
-0.10271820425987244,
-0.049354854971170425,
-0.055738139897584915,
0.013217085972428322,
0.013849622569978237,
0.09116585552692413,
0.05216317996382713,
-0.00837879441678524,
0.0464133620262146,
-0.01044970378279686,
0.05477564409375191,
-0.026014428585767746,
-0.001173704513348639,
0.0022124918177723885,
0.03065471351146698,
0.07647182047367096,
0.07389799505472183,
-0.005795970559120178,
-0.07854931801557541,
-0.04907945916056633,
-0.013740096241235733,
-0.013098184019327164,
-0.026600196957588196,
0.00023228125064633787,
0.009565023705363274,
0.05302581563591957,
-0.0523621030151844,
-0.02576652728021145,
0.008274256251752377,
-0.020338213071227074,
0.015584398992359638,
-0.03614825755357742,
0.006268330384045839,
0.036880869418382645,
-0.011098813265562057,
0.004662139806896448,
0.017491009086370468,
0.06573306769132614,
0.011701547540724277,
0.036138277500867844,
0.1117096096277237,
0.04971364140510559,
0.023937132209539413,
0.010641202330589294,
-0.02406194806098938,
-0.0066932812333106995,
0.019962571561336517,
0.06228780373930931,
0.034523192793130875,
0.06635024398565292,
-0.03500073403120041,
0.07475458830595016,
-0.0378866121172905,
0.05885902792215347,
0.0123667661100626,
0.0033683942165225744,
0.06744785606861115,
-0.03752945363521576,
-0.011967504397034645,
-0.026434602215886116,
0.03977688029408455,
-0.030183641240000725,
0.08546694368124008,
-0.03120378963649273,
-0.027351297438144684,
-0.01445120107382536,
-0.05552313104271889,
-0.016734162345528603,
-0.09428578615188599,
0.036037396639585495,
-0.04630902409553528,
-0.01387853268533945,
0.001500910148024559,
-0.004781987983733416,
0.0019548535346984863,
0.0006819817936047912,
-0.05335703864693642,
0.02906760200858116,
0.0030452110804617405,
0.04172055050730705,
-0.07467839121818542,
-0.004307988099753857,
-0.08344320207834244,
0.019224606454372406,
0.07147758454084396,
-0.014791854657232761,
0.026968568563461304,
-0.039765797555446625,
-0.013828659430146217,
-0.08377131819725037,
0.041675712913274765,
0.005277384538203478,
-0.06006735935807228,
0.010793866589665413,
0.015272704884409904,
0.022149482741951942,
0.01512757409363985,
-0.004527449142187834,
-0.012935543432831764,
-0.03776730224490166,
-0.013095385394990444,
-0.048143234103918076,
-0.017418906092643738,
0.034333061426877975,
0.003142914967611432,
0.048323437571525574,
-0.03474922850728035,
-0.004325039219111204,
-0.00014415760233532637,
-0.04636875540018082,
-0.059930045157670975,
0.0034931458067148924,
-0.059927452355623245,
-0.024852020666003227,
0.01490060891956091,
0.05583285540342331,
0.026326831430196762,
-0.03696326166391373,
0.006741013377904892,
-0.0030682350043207407,
-0.06642714887857437,
0.03142065554857254,
0.0037036347202956676,
0.0017363938968628645,
-0.015277402475476265,
0.019609834998846054,
-0.02694837749004364,
-0.008354587480425835,
-0.0055337161757051945,
0.022408809512853622,
-0.006945227272808552,
0.05902312695980072,
-0.0698198601603508,
-0.04078444465994835,
0.030125360935926437,
0.010561134666204453,
-0.04395989701151848,
-0.024733366444706917,
-0.028281502425670624,
-0.058289363980293274,
-0.04675664007663727,
0.030668746680021286,
-0.002263790462166071,
0.002689843764528632,
0.015689371153712273,
-0.01950017176568508,
-0.03821331635117531,
-0.009851339273154736,
-0.08586031943559647,
0.05122917518019676,
0.02099631354212761,
0.0006388869951479137,
0.02541801519691944,
-0.0322190523147583,
-0.033301420509815216,
0.09745650738477707,
-0.012861361727118492,
-0.05405476689338684,
-0.008959059603512287,
0.07859686017036438,
0.023672476410865784,
-0.03663608431816101,
-0.045123424381017685,
0.003407943295314908,
0.036900319159030914,
-0.0012528724037110806,
0.051791124045848846,
0.015041890554130077,
0.03089899756014347,
0.008894169703125954,
0.03784835338592529,
0.04624969884753227,
-0.0602201484143734,
-0.0167662613093853,
0.04718945175409317,
0.03888638690114021,
0.040561284869909286,
-0.015315012075006962,
-0.029687007889151573,
0.075917549431324,
0.02619314193725586,
0.011586178094148636,
0.01692967861890793,
-0.05843432620167732,
-0.030753903090953827,
0.04426487162709236,
-0.002235148334875703,
0.00011897759395651519,
0.022682417184114456,
0.04427789896726608,
-0.0253220833837986,
0.016511814668774605,
0.014768368564546108,
0.06125757098197937,
0.01421970222145319,
0.005477714352309704,
0.05005384981632233,
0.0009486618218943477,
0.004594333469867706,
0.008400551043450832,
0.04632335156202316,
0.008378999307751656,
0.042716316878795624,
-0.07891610264778137,
-0.03962177783250809,
-0.030608778819441795,
0.02148515172302723,
-0.016777973622083664,
-0.03356126695871353,
0.018223969265818596,
-0.017884358763694763,
-0.046243660151958466,
0.03091009333729744,
0.04488755017518997,
0.06628728657960892,
0.14274229109287262,
0.033918581902980804,
0.005349063780158758,
0.03341435268521309,
0.05175795778632164,
-0.012876573018729687,
0.08838945627212524,
0.04307498037815094,
-0.039001114666461945,
0.05480039119720459,
0.018039382994174957,
0.023021742701530457,
-0.037194445729255676,
0.08447261899709702,
0.004635825287550688,
0.007818537764251232,
-0.0471501424908638,
-0.04337930306792259,
-0.03731657192111015,
0.029189802706241608,
-2.943669824162498e-05,
0.04206568002700806,
-0.046573907136917114,
0.049842674285173416,
-0.07550699263811111,
0.013699652627110481,
0.01364654116332531,
0.044443529099226,
-0.032991472631692886,
0.00199594022706151,
0.03455238416790962,
0.06704609841108322,
0.10915092378854752,
0.013607824221253395,
0.030938198789954185,
0.03007160872220993,
0.03932444006204605,
0.03017045184969902,
-0.045967865735292435,
0.07971260696649551,
-0.03735628351569176,
0.004719314631074667,
0.025986433029174805,
0.05499814823269844,
0.03798016905784607,
-0.03506499156355858,
-0.07836069166660309,
-0.006422300357371569,
0.08364897966384888,
0.031139858067035675,
0.0237562395632267,
0.03418833762407303,
-0.04556337743997574,
-0.054386042058467865,
0.037647366523742676,
0.07103682309389114,
0.032817550003528595,
0.017459850758314133,
0.025301214307546616,
0.012718969956040382,
0.040260981768369675,
0.053317587822675705,
-0.02250387705862522,
0.06267426162958145,
-0.041697483509778976,
-0.0776071771979332,
-0.029911287128925323,
-0.009513238444924355,
-0.011716986075043678,
0.04091794043779373,
-0.07932541519403458,
-0.05547358840703964,
0.022563990205526352,
0.056522518396377563,
-0.05715760216116905,
0.017715174704790115,
-0.027290472760796547,
0.007600400596857071,
-0.012442394159734249,
-0.07039974629878998,
-0.00028295081574469805,
0.07013864815235138,
-0.04879284277558327,
0.016179071739315987,
0.0013504876988008618,
-0.041525281965732574,
0.02081078104674816,
-0.0196123868227005,
0.032823868095874786,
0.02349238656461239,
-0.017578549683094025,
0.04525979235768318,
0.012601063586771488,
0.05026762932538986,
-0.0040748827159404755,
0.03857560455799103,
0.08672965317964554,
0.028569836169481277,
-0.012252695858478546,
0.05252901092171669,
-0.030442694202065468,
-0.047434158623218536,
0.011545209214091301,
0.004960620775818825,
-0.0417361781001091,
-0.059848688542842865,
-0.002107459818944335,
-0.05377114191651344,
0.05968847870826721,
0.053163085132837296,
-0.05112070590257645,
-0.04243450611829758,
-0.03251194208860397,
0.013431361876428127,
-0.01739482954144478,
-0.001889650709927082,
0.05608241632580757,
-0.01217451598495245,
0.016882428899407387,
0.010958705097436905,
0.000917949597351253,
0.005902082193642855,
0.01774146594107151,
0.019388500601053238,
0.031179876998066902,
0.03483326733112335,
0.08622352033853531,
-0.023635651916265488,
0.04065284878015518,
0.04532768949866295,
0.004761804360896349,
-0.012697340920567513,
-0.01930900476872921,
0.020402081310749054,
-0.054622046649456024,
0.022921158000826836,
0.029295874759554863,
-0.012813729234039783,
0.033268582075834274,
-0.02670474536716938,
0.019629303365945816,
0.03199295327067375,
0.009693413972854614,
-0.05808739364147186,
0.022128207609057426,
0.007398845162242651,
0.05463213473558426,
-0.001370777958072722,
-0.010825964622199535,
-0.004721509292721748,
0.01866617053747177,
0.06790919601917267,
0.004824503790587187,
0.030829856172204018,
0.062489259988069534,
-0.031852807849645615,
-0.039454106241464615,
-0.05762400105595589,
-0.034367915242910385,
0.026951737701892853,
-0.0058794948272407055,
-0.018224380910396576,
-0.0033117542043328285,
-0.015716953203082085,
-0.04995019733905792,
-0.02712280862033367,
-0.008370775729417801,
-0.03431384637951851,
0.0416133776307106,
0.0005534720839932561,
0.002803171519190073,
-0.046293120831251144,
-0.06276726722717285,
-0.0257625263184309,
-0.018244262784719467,
-0.025223413482308388,
-0.01072604674845934,
-0.05687200278043747,
0.003217678051441908,
-0.04279552027583122,
-0.027273062616586685,
-0.026034438982605934,
0.005079316906630993,
0.00520298769697547,
-0.018159575760364532,
0.011921577155590057,
0.003878217190504074,
-0.08502774685621262,
-0.03791035711765289,
0.04824737459421158,
-0.024019774049520493,
-0.019636359065771103,
-0.03588871285319328,
0.08719196915626526,
0.028716744855046272,
-0.04219309985637665,
0.024259814992547035,
-0.027386216446757317,
-0.0009738823282532394,
0.016394784674048424,
0.102895587682724,
0.03388987109065056,
0.00011744347284547985,
-0.020539140328764915,
-0.06474660336971283,
0.06117396429181099,
-0.02797951176762581,
0.006057301070541143,
0.0028115161694586277,
0.0039796908386051655,
-0.015010246075689793,
0.10862033069133759,
-0.03992471843957901,
0.08181249350309372,
0.07777091860771179,
0.06840945780277252,
0.025010455399751663,
0.007091366220265627,
-0.01059243455529213,
0.0447077713906765,
0.0604066327214241,
0.022920845076441765,
0.08226370066404343,
0.013317991979420185,
0.0011763354996219277,
0.03883127123117447,
0.0745445266366005,
0.05125625804066658,
-0.03705110028386116,
0.011146004311740398,
-0.027503741905093193,
-0.027643678709864616,
0.020032767206430435,
-0.057130493223667145,
0.0054396879859268665,
0.04384961724281311,
0.07611638307571411,
-0.03160066157579422,
0.011447485536336899,
-0.05587098002433777,
0.016214223578572273,
-0.004277338273823261,
-0.012149898335337639,
0.0005352659500204027,
-0.0011923728743568063,
0.09622707962989807,
-0.013957038521766663,
0.02614167146384716,
-0.04715534672141075,
0.07046947628259659,
-0.030087245628237724,
-0.07538038492202759,
0.005601473618298769,
0.020381541922688484,
0.0007213251665234566,
-0.03494713827967644,
0.09191235899925232,
0.0776251032948494,
0.01217822078615427,
0.03080901876091957,
-0.009339629672467709,
0.008593853563070297,
0.09997996687889099,
-0.04608052223920822,
-0.046993814408779144,
-0.0025786906480789185,
0.04704232141375542,
-0.03138108551502228,
-0.03445694223046303,
0.01121643465012312,
0.06339779496192932,
-0.027784790843725204,
0.035187043249607086,
0.03848481550812721,
0.04067709669470787,
0.02477540634572506,
-0.017407990992069244,
-0.02562996745109558,
-0.017839206382632256,
-0.013904049061238766,
0.07074828445911407,
-0.01998770982027054,
0.04176481068134308,
0.025349991396069527,
0.03619129955768585,
-0.028926564380526543,
0.023561900481581688,
0.06832046806812286,
-0.0022936644963920116,
-0.037927981466054916,
-0.011110823601484299,
0.003997039515525103,
-0.018610212951898575,
-0.0777856633067131,
-0.06572680920362473,
0.015108302235603333,
0.07599352300167084,
0.06262318789958954,
0.016255853697657585,
-0.020373031497001648,
0.010496476665139198,
-0.06893618404865265,
-0.0399383120238781,
-0.04000330716371536,
-0.013301906175911427,
-0.006480810232460499,
0.11576880514621735,
0.03634243085980415,
-0.005271580535918474,
-0.014077144674956799,
-0.026059696450829506,
0.013743389397859573,
-0.013923931866884232,
-0.010056555271148682,
-0.046551626175642014,
-0.07423108071088791,
-0.03545554727315903,
0.030452528968453407,
-0.0164776723831892,
-0.03782391920685768,
-0.030053239315748215,
-0.0450371690094471,
-0.017368139699101448,
-0.03565021976828575,
-0.03353315219283104,
0.008026614785194397,
-0.023412618786096573,
-0.025333400815725327,
-0.03468359634280205,
0.011942660436034203,
-0.04171815142035484,
-0.015292288735508919,
-0.016381343826651573,
-0.011084257625043392,
-0.008780824951827526,
-0.022404469549655914,
-0.09128870815038681,
-0.029446301981806755,
0.005666058510541916,
-0.04409130662679672,
-0.02468474768102169,
-0.08587147295475006,
0.01264773029834032,
0.0693143829703331,
0.04210692644119263,
-0.008101150393486023,
0.04196253791451454,
-0.057191651314496994,
0.03887677565217018,
0.0007247937028296292,
-0.07097858190536499,
-0.028197672218084335,
0.01593373529613018,
0.027537429705262184,
0.04274371266365051,
0.026650140061974525,
-0.06849484145641327,
0.033079057931900024,
0.016998326405882835,
0.0614488385617733,
-0.03208369016647339,
-0.0011799107305705547,
-0.008556938730180264,
-0.04253137484192848,
0.006528179626911879,
-0.008368730545043945,
0.006762103643268347,
0.032385826110839844,
-0.0629633367061615,
-0.020283207297325134,
-0.10449697077274323,
-0.03983088955283165,
-0.0652599185705185,
-0.011780574917793274,
-0.00901532918214798,
-0.017431063577532768,
8.897688530851156e-05
],
"name": "fc7_offset",
"shape": [
1000
]
},
{
"data": [
-1.1135177612304688,
6.288958549499512,
3.139874219894409,
1.9048583507537842,
0.03913835436105728,
2.6481428146362305,
2.8079400062561035,
2.1263062953948975,
-0.6012501120567322,
-4.3257622718811035,
-5.596638202667236,
-3.122722864151001,
0.15927131474018097,
-2.9604926109313965,
-4.069268226623535,
-0.3509599566459656,
-3.8499019145965576,
-3.502720832824707,
-1.8450493812561035,
-2.911593437194824,
-3.2176897525787354,
2.9500503540039062,
1.2102972269058228,
0.7517126202583313,
-1.9848179817199707,
-0.08928977698087692,
1.0721582174301147,
-0.14318805932998657,
-1.3973617553710938,
0.9336868524551392,
1.3169736862182617,
-0.5166665315628052,
2.9748587608337402,
2.222357988357544,
4.300759315490723,
0.30319321155548096,
-0.006494995206594467,
-2.8430075645446777,
-1.144093632698059,
-1.9795348644256592,
-1.3029303550720215,
-2.991396903991699,
1.069321632385254,
2.152038335800171,
-2.551513671875,
-1.9288045167922974,
-1.5026218891143799,
-3.02573823928833,
-4.000486850738525,
-3.1551754474639893,
0.9542933702468872,
-2.602130174636841,
-3.8310000896453857,
-3.5045058727264404,
0.1277388483285904,
-1.756664514541626,
-2.5417673587799072,
-2.5876262187957764,
-1.9096553325653076,
0.180572509765625,
0.7920528650283813,
-4.119457721710205,
-2.2808122634887695,
-2.2101640701293945,
-0.2808034420013428,
-1.6263320446014404,
-0.8479610085487366,
-0.4797917902469635,
-1.818886399269104,
-1.5055320262908936,
-1.4128488302230835,
-2.5348434448242188,
-1.887861967086792,
2.948688268661499,
1.7228940725326538,
-0.4362483322620392,
1.1495392322540283,
1.4625887870788574,
1.5648139715194702,
-0.7236918210983276,
1.599829912185669,
0.7933265566825867,
1.2352303266525269,
-0.8543774485588074,
-5.039606094360352,
-1.5521436929702759,
-0.7921367287635803,
-2.934796094894409,
-1.9191449880599976,
-4.304612636566162,
-1.9234520196914673,
-3.6729063987731934,
-4.655753135681152,
-2.873351573944092,
-0.7903644442558289,
-4.490265846252441,
-1.8164656162261963,
-0.7162665724754333,
-3.195564031600952,
-1.1332260370254517,
-1.2450087070465088,
2.654376983642578,
-4.2748122215271,
-1.4303213357925415,
-1.614728331565857,
-4.476330757141113,
1.6490802764892578,
5.233551502227783,
-0.3165779113769531,
-2.0802481174468994,
2.3546152114868164,
3.9514129161834717,
6.232498645782471,
1.0490273237228394,
0.9326438307762146,
3.712100028991699,
-0.8434510231018066,
2.6792490482330322,
3.1296162605285645,
3.223210096359253,
-1.6055116653442383,
5.80521821975708,
3.3964550495147705,
1.011749267578125,
1.6933361291885376,
5.176721572875977,
2.3967502117156982,
-0.6730397343635559,
-2.7001023292541504,
-3.7109756469726562,
-1.14090096950531,
-4.587691307067871,
-1.333116054534912,
-4.107562065124512,
-3.6067891120910645,
0.022360533475875854,
-4.151522159576416,
-3.132967472076416,
-5.283032417297363,
-1.1128923892974854,
-5.726787567138672,
-3.259611129760742,
-6.0796637535095215,
-1.5227385759353638,
0.7056931853294373,
2.0717215538024902,
-1.8915910720825195,
6.9576215744018555,
2.1103978157043457,
-2.5883052349090576,
-0.4441264569759369,
0.29632315039634705,
-4.115409851074219,
-1.7699885368347168,
-1.0301513671875,
-1.3696787357330322,
-2.761214256286621,
-2.2525429725646973,
-3.8018980026245117,
-2.6193923950195312,
-1.1923953294754028,
-0.8128389120101929,
-2.585618257522583,
-0.6347448825836182,
-1.7189230918884277,
-0.9218324422836304,
-3.2434442043304443,
-2.1508426666259766,
0.20600341260433197,
-2.162846803665161,
0.826657772064209,
-2.9015021324157715,
-2.265634775161743,
-0.6910134553909302,
-0.8061107993125916,
-0.7938972115516663,
-3.5841989517211914,
-0.9715676307678223,
-1.3360918760299683,
-2.2801849842071533,
-3.5794837474823,
-2.046212911605835,
-0.49998578429222107,
2.6022450923919678,
3.2232179641723633,
-0.43327096104621887,
-0.43072545528411865,
0.028539717197418213,
2.9475526809692383,
0.2802347242832184,
-1.561449408531189,
2.756429433822632,
-1.04819917678833,
-2.1431262493133545,
-4.478471755981445,
-0.06046929955482483,
1.0384304523468018,
0.2062852531671524,
-0.8454253673553467,
2.7614078521728516,
-1.2345904111862183,
-1.400450348854065,
-0.1786937266588211,
1.6461610794067383,
-1.7984795570373535,
-2.061809778213501,
-2.770155429840088,
0.7444724440574646,
-2.25679087638855,
-1.143601417541504,
-3.0761778354644775,
0.2368452250957489,
2.2915382385253906,
3.751492977142334,
0.9513205885887146,
0.22786934673786163,
-2.7496840953826904,
0.6290023922920227,
0.003699198365211487,
2.7009973526000977,
0.48269402980804443,
-0.861529529094696,
-1.8455449342727661,
1.311780571937561,
2.8576531410217285,
-3.386429786682129,
-0.9015589952468872,
-2.7003421783447266,
-0.37863194942474365,
-1.1736881732940674,
0.23105797171592712,
0.24713507294654846,
-0.3406108021736145,
1.2424044609069824,
-0.8538718223571777,
-0.2684188485145569,
-1.2067370414733887,
-0.7052292227745056,
-2.275963306427002,
-1.8765861988067627,
1.1009433269500732,
-0.9290322661399841,
-0.5795953869819641,
-4.521215438842773,
-2.0830078125,
-0.03133445233106613,
-2.6075408458709717,
-0.8438606858253479,
-1.4943246841430664,
-0.8214187026023865,
0.4131604731082916,
2.144296169281006,
-0.5544344186782837,
-1.3938241004943848,
-1.8246674537658691,
-3.185823678970337,
-0.5576209425926208,
-2.192222833633423,
2.806727170944214,
1.1733990907669067,
-0.08159276098012924,
-2.1470870971679688,
-0.6794589757919312,
-1.6413061618804932,
-1.389523983001709,
0.3174307346343994,
-1.4913421869277954,
2.589702844619751,
-5.424981594085693,
3.14266300201416,
1.9202947616577148,
1.3934451341629028,
-0.28893977403640747,
2.783479928970337,
0.7540513277053833,
2.1970536708831787,
3.844935178756714,
2.0208959579467773,
-3.0737786293029785,
-0.3650449514389038,
-0.9322575926780701,
-2.5201945304870605,
-3.770314931869507,
1.6335101127624512,
-1.870066523551941,
-2.0942318439483643,
1.506428599357605,
-1.9663705825805664,
0.9056843519210815,
-2.3463313579559326,
-0.8382065892219543,
2.1236884593963623,
-5.041065216064453,
0.07987252622842789,
6.912156105041504,
2.558126449584961,
3.1287927627563477,
0.08568187057971954,
-0.11802269518375397,
0.906413197517395,
-6.439662933349609,
1.396309494972229,
0.6348122954368591,
-1.2416276931762695,
-0.1382899135351181,
-4.502665042877197,
-0.7919870615005493,
-1.5633372068405151,
0.46295979619026184,
3.5294690132141113,
2.5100436210632324,
-1.5220637321472168,
-1.243208885192871,
2.140782356262207,
-1.107566237449646,
0.5321031808853149,
-2.3318674564361572,
-1.4352529048919678,
0.05798972770571709,
0.6704398393630981,
0.8080523610115051,
1.4889743328094482,
-2.9919238090515137,
-0.5327302813529968,
-1.7200275659561157,
-2.7397515773773193,
-4.664469242095947,
6.672308921813965,
2.1278116703033447,
4.903074741363525,
-2.885180950164795,
0.3048209547996521,
-2.2697489261627197,
-0.3579505383968353,
-3.4912190437316895,
0.8643660545349121,
2.4931955337524414,
0.2035190761089325,
-3.760498285293579,
4.380125999450684,
-1.3057351112365723,
-1.369592308998108,
-2.401876926422119,
-2.4498915672302246,
-0.7065585255622864,
1.6136775016784668,
-4.125005722045898,
5.1046552658081055,
-1.864634394645691,
-2.7479870319366455,
2.8492558002471924,
-1.8721797466278076,
-3.5855660438537598,
-5.791052341461182,
4.716646194458008,
0.7182656526565552,
-1.5115002393722534,
-2.3466901779174805,
-2.1319382190704346,
-1.7151187658309937,
-0.7809315323829651,
-1.3043848276138306,
-3.4859538078308105,
-1.9124085903167725,
-3.841890573501587,
2.875410556793213,
-1.4392427206039429,
-0.7927815318107605,
-5.1780219078063965,
-4.427769660949707,
-3.303980827331543,
-3.0374269485473633,
0.5805526375770569,
0.003860095515847206,
0.616568386554718,
-4.566771984100342,
-2.314667224884033,
-0.9728753566741943,
-0.5612640380859375,
-2.1157753467559814,
0.5822577476501465,
0.19072259962558746,
-1.9761295318603516,
-5.34631872177124,
-0.15873247385025024,
1.5741854906082153,
0.19256766140460968,
-0.893580436706543,
-4.563290119171143,
3.085646390914917,
1.2774627208709717,
-1.228529691696167,
-0.5872294902801514,
-0.7993833422660828,
-0.27998870611190796,
0.20474407076835632,
0.45689675211906433,
-0.4169624447822571,
-1.458970069885254,
0.4040461480617523,
1.5903464555740356,
0.8884001970291138,
1.4965789318084717,
0.8713038563728333,
1.190368413925171,
4.0006818771362305,
1.3812894821166992,
2.443248748779297,
-3.691615343093872,
3.6675219535827637,
-0.28525710105895996,
-4.323070049285889,
-0.7842081189155579,
-0.9959515929222107,
-2.7769031524658203,
-1.2515490055084229,
-2.0718178749084473,
5.263943672180176,
2.7395377159118652,
-0.20292477309703827,
2.0371251106262207,
4.687855243682861,
-1.6174226999282837,
-6.011782646179199,
-2.406636953353882,
5.687418460845947,
2.068570137023926,
2.6315081119537354,
-1.2711865901947021,
-1.9762932062149048,
-4.717271327972412,
-0.9369955658912659,
3.616706609725952,
1.6450910568237305,
-0.5974013209342957,
1.9036098718643188,
-3.0006422996520996,
8.5920991897583,
0.9085093140602112,
1.8057917356491089,
2.794481039047241,
3.6742942333221436,
5.859650611877441,
-5.367660999298096,
-0.23054727911949158,
0.16943949460983276,
-3.502530336380005,
4.531452178955078,
2.216261625289917,
2.0808639526367188,
-5.725005149841309,
0.7010980248451233,
-0.26391342282295227,
-1.183639645576477,
-2.2641284465789795,
-0.19194045662879944,
-0.1496332883834839,
1.1107094287872314,
0.6537806987762451,
0.06566338986158371,
4.320130348205566,
-0.08742954581975937,
-2.0149173736572266,
0.44996148347854614,
1.3544546365737915,
-2.3553712368011475,
-1.5237796306610107,
-0.3587614893913269,
2.0180962085723877,
6.839800834655762,
6.757830619812012,
5.435042858123779,
1.472086787223816,
-5.827995300292969,
-1.7366204261779785,
5.700528621673584,
4.597124099731445,
-6.591582298278809,
-4.777801036834717,
-3.023289918899536,
-0.7286937832832336,
-3.7894070148468018,
-4.362597465515137,
3.1441218852996826,
-1.2777856588363647,
-1.8854466676712036,
-0.1450381726026535,
-2.446958065032959,
5.533286094665527,
3.4368019104003906,
1.0337337255477905,
1.9079962968826294,
-0.6734300255775452,
-2.2918312549591064,
4.700782299041748,
-3.3590245246887207,
1.4271029233932495,
4.843199729919434,
5.300411701202393,
-1.0196391344070435,
-1.975170373916626,
3.3577330112457275,
-5.640188217163086,
-0.9089413285255432,
1.9050424098968506,
1.7370647192001343,
2.779188394546509,
-2.3282089233398438,
-0.3661664128303528,
-7.736055850982666,
3.3626389503479004,
-0.9660972952842712,
-0.5348708629608154,
6.016900062561035,
-1.907275915145874,
4.409943580627441,
-1.3399814367294312,
5.80074405670166,
-0.9423139691352844,
-3.0581214427948,
-4.232025146484375,
0.49505308270454407,
-2.8248448371887207,
1.8452928066253662,
-0.29495081305503845,
1.954695701599121,
-3.5908143520355225,
-0.058506038039922714,
-4.066666126251221,
-4.578606128692627,
3.1549646854400635,
0.3313584327697754,
-4.844637870788574,
-3.786264657974243,
-2.9295287132263184,
-4.7329277992248535,
2.771017551422119,
-0.8390169739723206,
4.628056526184082,
-3.1337990760803223,
8.086268424987793,
2.15596866607666,
1.509993553161621,
-0.20340439677238464,
2.465909719467163,
-0.9388576745986938,
0.8679890632629395,
-5.339540958404541,
-5.248732566833496,
0.3937181234359741,
-2.2340128421783447,
-4.198233127593994,
3.6622326374053955,
-1.4968304634094238,
5.655033111572266,
6.639937400817871,
9.50888729095459,
8.135913848876953,
4.130185127258301,
-1.1507993936538696,
-3.7683653831481934,
-3.5123729705810547,
10.17003345489502,
3.0891218185424805,
-4.775205612182617,
-2.8696086406707764,
3.1166598796844482,
-0.09823939204216003,
1.4306693077087402,
0.11904144287109375,
4.376938819885254,
-0.13451887667179108,
-0.09921831637620926,
-4.0052595138549805,
-0.6812946200370789,
0.29452043771743774,
1.232026219367981,
1.1641405820846558,
4.678610801696777,
-1.1426453590393066,
4.305626392364502,
-0.6170145273208618,
-2.9588119983673096,
0.6505197882652283,
-0.7002402544021606,
1.679695725440979,
0.905500590801239,
0.7201970219612122,
-3.2486212253570557,
-2.017725944519043,
-5.236093997955322,
0.31017568707466125,
-4.776829719543457,
0.771937906742096,
-0.5375965237617493,
1.6099820137023926,
0.2525595426559448,
-3.0072057247161865,
-2.222247362136841,
2.557495355606079,
2.604846477508545,
2.8686323165893555,
-0.2671038508415222,
-3.6298811435699463,
4.030196189880371,
-2.228626251220703,
-2.7869765758514404,
8.178828239440918,
-0.9561513066291809,
2.5749263763427734,
0.1051970049738884,
-0.8775336742401123,
-4.546533584594727,
-2.958195447921753,
-0.10180419683456421,
-3.051948070526123,
4.536789417266846,
-0.9246405959129333,
0.23328013718128204,
7.733509063720703,
2.585641384124756,
-3.2604427337646484,
3.1121461391448975,
-0.3049006462097168,
-2.0115468502044678,
-0.8986498117446899,
4.7046332359313965,
0.3298841416835785,
5.715729236602783,
0.5911621451377869,
-3.0967226028442383,
-2.4492650032043457,
0.8132742643356323,
-0.08068384975194931,
-1.1273431777954102,
-1.510864019393921,
-4.215301513671875,
0.021838083863258362,
2.4892895221710205,
-0.36609962582588196,
-4.941051959991455,
0.870089054107666,
0.8415865898132324,
2.778775930404663,
6.891691207885742,
5.314716815948486,
4.067209720611572,
-3.2592508792877197,
-0.5322805643081665,
3.2613449096679688,
3.712477445602417,
1.4212429523468018,
0.7374931573867798,
-1.1152633428573608,
-2.0120372772216797,
0.27490660548210144,
-0.018865203484892845,
6.346681594848633,
0.9549524784088135,
-2.9575817584991455,
2.4913063049316406,
-3.3575847148895264,
-3.308088541030884,
0.789000391960144,
2.1385583877563477,
0.5199357271194458,
0.9427002668380737,
1.212093710899353,
2.4850857257843018,
0.16598199307918549,
-0.22598697245121002,
1.4501450061798096,
4.240878582000732,
-2.1890220642089844,
-2.833745002746582,
-3.2725131511688232,
-1.8148906230926514,
2.188467502593994,
-0.8708044290542603,
0.40772077441215515,
0.8311145305633545,
-0.09439480304718018,
6.006947994232178,
4.909032821655273,
0.039429258555173874,
-0.05254539102315903,
-4.063587665557861,
-1.1732741594314575,
-0.37565234303474426,
0.9866915941238403,
-2.3882200717926025,
-0.5323681831359863,
-2.7551889419555664,
2.324697971343994,
2.933861494064331,
-0.5581904053688049,
-0.814734935760498,
-2.680150032043457,
2.7688400745391846,
2.2362000942230225,
0.012518439441919327,
4.497869968414307,
0.05619104206562042,
2.188314199447632,
1.1976550817489624,
-1.223286747932434,
-1.96990168094635,
-2.6140923500061035,
2.6416029930114746,
-5.036900043487549,
-2.9750781059265137,
3.8761379718780518,
0.3950593173503876,
-0.9626359939575195,
0.6379157900810242,
1.320874571800232,
7.905311107635498,
-1.404468297958374,
6.345209121704102,
-0.34226953983306885,
-2.877328634262085,
-2.9425530433654785,
-3.3539328575134277,
-0.6594979763031006,
2.189342737197876,
-0.53953617811203,
-5.761833190917969,
4.170668125152588,
1.1384563446044922,
-6.1796698570251465,
-0.2715799808502197,
5.205389976501465,
-3.832481861114502,
5.0490217208862305,
-1.2221055030822754,
1.9642716646194458,
-1.650144338607788,
2.029522657394409,
1.2838444709777832,
-0.8694071173667908,
-1.898804783821106,
-2.2001187801361084,
-2.0704314708709717,
-0.5554717183113098,
5.328458309173584,
3.0391457080841064,
-4.295654296875,
-0.6730002760887146,
-5.105440616607666,
0.5214884877204895,
-1.2292194366455078,
-0.874693751335144,
-3.9954285621643066,
-0.25534865260124207,
-2.1901192665100098,
8.093463897705078,
-0.864460825920105,
0.9975801706314087,
0.45381563901901245,
0.045608773827552795,
0.10333479940891266,
-0.9367854595184326,
2.658450126647949,
4.847926616668701,
3.1627864837646484,
-3.9572408199310303,
6.637692928314209,
-1.3587199449539185,
-0.2942392826080322,
-1.0709693431854248,
-1.36146080493927,
-2.3354504108428955,
2.2582101821899414,
0.5794234275817871,
-5.089783668518066,
3.9759581089019775,
6.722696781158447,
-2.363520860671997,
-1.4506551027297974,
0.37265485525131226,
4.414368629455566,
0.922224223613739,
2.80344820022583,
2.1870365142822266,
1.3715001344680786,
2.5108563899993896,
-0.06768710911273956,
0.016961902379989624,
-5.491759300231934,
-2.188974618911743,
-6.869897365570068,
-2.2394344806671143,
0.7793116569519043,
-1.2509632110595703,
0.9370380640029907,
3.8124663829803467,
4.098287105560303,
-0.8360494375228882,
-3.8020546436309814,
-2.546821355819702,
-5.982780933380127,
4.361058712005615,
4.002274990081787,
1.437463402748108,
-3.3148815631866455,
2.476943016052246,
-2.668372631072998,
2.2998201847076416,
0.49358779191970825,
-1.8316415548324585,
-2.4343361854553223,
1.4462699890136719,
8.074532508850098,
1.0543357133865356,
0.7284864783287048,
2.763704538345337,
-3.4147086143493652,
-0.8495263457298279,
5.51450777053833,
5.865904331207275,
-0.8634836673736572,
3.999297857284546,
2.2077524662017822,
-2.4316718578338623,
4.192683219909668,
-1.4159584045410156,
2.08917498588562,
4.5429205894470215,
1.570852279663086,
-1.2582975625991821,
-4.257433891296387,
-2.7160749435424805,
5.726667404174805,
-0.6142498254776001,
2.568885087966919,
0.2809735834598541,
3.1567347049713135,
2.23248291015625,
1.1155951023101807,
6.1784281730651855,
-1.052476406097412,
-0.8833615779876709,
1.846227765083313,
0.8825157880783081,
-1.4468894004821777,
-0.7930479049682617,
3.6737775802612305,
1.7499536275863647,
-4.472019195556641,
1.1047037839889526,
1.6641494035720825,
0.6249755620956421,
1.4401034116744995,
-0.8742496967315674,
2.05430269241333,
-1.0177077054977417,
-0.8829973340034485,
-1.9259483814239502,
0.11630228161811829,
3.4688310623168945,
-2.9769351482391357,
-1.9840682744979858,
15.044188499450684,
-0.8570810556411743,
1.9501405954360962,
-3.4981689453125,
2.510443925857544,
3.5899503231048584,
-2.3726158142089844,
0.23363883793354034,
0.7484949827194214,
0.6284427046775818,
4.868407726287842,
2.7781155109405518,
-4.688655376434326,
5.553494930267334,
3.472703695297241,
-1.9815202951431274,
-3.3022358417510986,
2.9350814819335938,
3.9785258769989014,
-2.3674871921539307,
-3.2281105518341064,
1.634751319885254,
2.797602891921997,
0.10491600632667542,
-3.9945390224456787,
-0.1846565306186676,
2.214176654815674,
0.6928108334541321,
-3.3444647789001465,
-4.4965410232543945,
-1.9258458614349365,
-4.55368185043335,
-6.066025733947754,
1.579517126083374,
-0.061298128217458725,
-2.0320396423339844,
3.6613049507141113,
1.1991220712661743,
6.71068000793457,
-0.20035995543003082,
3.4695675373077393,
2.9921772480010986,
5.865469455718994,
1.018076777458191,
-2.018195152282715,
1.5514839887619019,
7.364731788635254,
4.011137008666992,
0.29808133840560913,
0.16895072162151337,
3.170443534851074,
2.274421215057373,
-2.9727365970611572,
2.680772542953491,
-0.8444386124610901,
0.36728426814079285,
0.18071646988391876,
3.6657981872558594,
7.069464683532715,
-0.10921701788902283,
0.49952876567840576,
-0.10052265971899033,
-3.0640199184417725,
-0.9281572103500366,
-1.3727264404296875,
-3.9582407474517822,
-1.478290319442749,
2.8559329509735107,
-2.2887556552886963,
-5.962973117828369,
1.1702955961227417,
-3.0737810134887695,
-1.6734060049057007,
-1.360888957977295,
-1.488382339477539,
-0.10332925617694855,
-0.2492319941520691,
-3.1653268337249756,
0.425719290971756,
3.8211510181427,
2.053650140762329,
-0.2018033117055893,
-4.402004718780518,
2.985631227493286,
-2.2109131813049316,
0.4897245764732361,
-0.9589419960975647,
0.4612155854701996,
2.5896759033203125,
0.3637409210205078,
3.290370225906372,
-0.8352606296539307,
-0.8434194326400757,
-5.34195613861084,
-3.4427998065948486,
2.6491568088531494,
1.8150891065597534,
-1.4421552419662476,
1.1361784934997559,
-0.7787467837333679,
-3.8555426597595215,
-2.4673306941986084,
-1.394074559211731,
-0.14918382465839386,
3.739903450012207,
-1.5827677249908447,
2.7378718852996826,
-0.5845848917961121,
8.43832015991211,
4.681511402130127,
4.540197849273682,
0.5192647576332092,
9.154011726379395,
5.119352340698242,
4.983821392059326,
2.6089601516723633,
4.969547748565674,
3.5975594520568848,
23.08266258239746,
-2.7487246990203857,
3.586392402648926,
1.721060037612915,
1.5361043214797974,
-0.09225545078516006,
0.9231963157653809,
1.0670558214187622,
2.5373518466949463,
3.4394421577453613,
4.816962242126465,
-4.113401412963867,
-2.359571695327759,
-1.250556230545044,
1.6705644130706787,
0.8198727369308472,
-4.548575401306152,
-2.211716890335083,
2.8640294075012207,
0.07712188363075256
],
"name": "fc_0.tmp_1",
"shape": [
1000
]
},
]
}
因为 它太大了无法显示 source diff 。你可以改为 查看blob
因为 它太大了无法显示 source diff 。你可以改为 查看blob
因为 它太大了无法显示 source diff 。你可以改为 查看blob
因为 它太大了无法显示 source diff 。你可以改为 查看blob
{
"ops": [
{
"attrs": {
"bias": 0.0,
"bias_after_scale": true,
"scale": 1.0
},
"inputs": {
"X": [
"fc_0.tmp_2"
]
},
"outputs": {
"Out": [
"scale_0.tmp_0"
]
},
"type": "scale"
}
],
"vars": [
{
"data": [
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.0,
1.6504194778766687e-16
],
"name": "fc_0.tmp_2",
"persistable": 0,
"shape": [
10
]
},
{
"data": [
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.0,
1.6504194778766687e-16
],
"name": "scale_0.tmp_0",
"persistable": 0,
"shape": [
10
]
}
]
}
{
"ops": [
{
"attrs": {
"bias": 0.0,
"bias_after_scale": true,
"scale": 1.0
},
"inputs": {
"X": [
"fc_0.tmp_2"
]
},
"outputs": {
"Out": [
"scale_0.tmp_0"
]
},
"type": "scale"
}
],
"vars": [
{
"data": [
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.0,
1.6504194778766687e-16
],
"name": "fc_0.tmp_2",
"persistable": 0,
"shape": [
10
]
},
{
"data": [
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.6038109389511792e-28,
1.0,
1.6504194778766687e-16
],
"name": "scale_0.tmp_0",
"persistable": 0,
"shape": [
10
]
}
]
}
{
"ops": [
{
"attrs": {
"axis": 2,
"num": 2,
"sections": []
},
"inputs": {
"X": ["reshape2_3.tmp_0"]
},
"outputs": {
"Out": ["split_1.tmp_0", "split_1.tmp_1"]
},
"type": "split"
}
],
"vars": [
{
"data": [
1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24
],
"name": "reshape2_3.tmp_0",
"shape": [2, 2, 2, 3]
},
{
"data": [1, 2, 3, 7, 8, 9, 13, 14, 15, 16, 17, 18],
"name": "split_1.tmp_0",
"shape": [2, 2, 1, 3]
},
{
"data": [4, 5, 6, 10, 11, 12, 16, 17, 18, 22, 23, 24],
"name": "split_1.tmp_1",
"shape": [2, 2, 1, 3]
}
]
}
import 'babel-polyfill'; import 'babel-polyfill';
import Paddle from '../../src/paddle/paddle'; import Paddle from '../../src/paddle/paddle';
import Utils from '../../src/utils/utils';
const unitPath = { const unitPath = {
'conv2d': 'model.test.conv2d.json', 'conv2d': 'model.test.conv2d.json',
...@@ -9,16 +10,24 @@ const unitPath = { ...@@ -9,16 +10,24 @@ const unitPath = {
'relu': 'model.test.relu.json', 'relu': 'model.test.relu.json',
'scale': 'model.test.scale.json', 'scale': 'model.test.scale.json',
'softmax': 'model.test.softmax.json', 'softmax': 'model.test.softmax.json',
'relu6' : 'model.test.relu6.json' 'relu6' : 'model.test.relu6.json',
'elementwise' : 'model.test.elementwise_add.json',
'depthwise' : 'model.test.depthwise_conv2d.json',
'reshape' : 'model.test.reshape.json',
'bilinear_interp' : 'model.test.bilinear_interp.json',
'transpose' : 'model.test.transpose.json',
'conv2d_transpose': 'model.test.conv2d_transpose.json',
'elementwise_add': 'model.test.elementwise_add.json',
'concat': 'model.test.concat.json',
'split': 'model.test.split.json'
}; };
// 制定运行的 op // 制定运行的 op
const modelType = 'softmax'; const modelType = 'split';
// 制定运行的 op
const unitData = unitPath[modelType]; const unitData = unitPath[modelType];
let Diff = require('./diff');
let datas; let datas;
let otherResult; let output;
let output
async function run() { async function run() {
const path = 'test/unitData'; const path = 'test/unitData';
const MODEL_CONFIG = { const MODEL_CONFIG = {
...@@ -35,8 +44,9 @@ async function run() { ...@@ -35,8 +44,9 @@ async function run() {
let model = await paddle.load(); let model = await paddle.load();
datas = model.graph.data; datas = model.graph.data;
output = deepCopy(datas); output = deepCopy(datas);
// 测试单元
model.graph.weightMap.forEach(op => { model.graph.weightMap.forEach(op => {
const type = op.type; const type = op.type;
if (type !== 'feed' && type !== 'fetch') { if (type !== 'feed' && type !== 'fetch') {
...@@ -45,18 +55,22 @@ async function run() { ...@@ -45,18 +55,22 @@ async function run() {
} }
}); });
const executor = model.graph.weightMap; const executor = model.graph.weightMap;
let inst = model.graph.execute_(executor[0]); model.graph.execute_(executor[0]);
let result = model.graph.inst.read(); // NHWC输出
console.dir(['result', result]); let result = await model.graph.inst.read();
var one = model.graph.inst.read();
// var other = getResult('conv2d');
console.log('one'); // 获取 NHWC -> NCHW 的 输出
console.log(one); const outputNCHWShape = getOutputShape();
console.log('other'); const outputNHWCShape = nchwShape2nhwcShape(outputNCHWShape);
} let nchwResult = Utils.nhwc2nchw(result, outputNHWCShape);
console.log('result');
console.log(result);
console.log('NCHW RESULT');
console.log(nchwResult);
}
run(); run();
...@@ -64,90 +78,44 @@ function deepCopy (data) { ...@@ -64,90 +78,44 @@ function deepCopy (data) {
return JSON.parse(JSON.stringify(data)); return JSON.parse(JSON.stringify(data));
} }
// let output = deepCopy(datas);
let getTensor = function(id, times = 1) {
let find = 0;
let data = datas.ops.filter((item, idx) => {
if (id === item.type) {
++find;
if (find === times) {
return true;
}
}
});
return getInputs(data[0]);
};
let getInputs = function(data) {
Object.keys(data.inputs).forEach(function(key){
data.inputs[key] = getValue(data.inputs[key][0], datas);
});
Object.keys(data.outputs).forEach(function(key){
let out = getValue(data.outputs[key][0], datas)
data.outputs[key] = out;
otherResult = out[0].data;
});
return data;
};
let getResult = function(id) {
let data = output.ops.filter((item, idx) => {
if (id === item.type) {
return true; const getResult = function (id) {
} const data = output.ops.filter(item => id === item.type);
});
return getoutputs(data[0]); return getoutputs(data[0]);
}; };
let getoutputs = function(data) {
let otherResult;
Object.keys(data.outputs).forEach(function(key){
let out = getValue(data.outputs[key][0], output);
otherResult = out[0].data;
});
return otherResult;
};
let getValue = function(name, datas) { const getValue = function(name, datas) {
return datas.vars.filter((item, idx) => { return datas.vars.find(item => name === item.name);
if (name === item.name) {
return item;
}
});
}; };
// // 测试单元
// let item = getTensor('conv2d');
let func = function (model) {
// console.log(other);
// var one = inst.read();
// var other = getResult('softmax');
// var color ='';
// var span = null;
// var diff = Diff.diffChars(one.toString(), other.toString()),
// display = document.getElementById('display'),
// fragment = document.createDocumentFragment();
//
// diff.forEach(function(part){
// // green for additions, red for deletions
// // grey for common parts
// color = part.added ? 'green' :
// part.removed ? 'red' : 'grey';
// span = document.createElement('span');
// span.style.color = color;
// span.appendChild(document
// .createTextNode(part.value));
// fragment.appendChild(span);
// });
//
// display.appendChild(fragment);
const OUTPUT_KEYS = ['out', 'y', 'output'];
const getoutputs = function (data) {
const outputkey = Object.keys(data.outputs).find(key => OUTPUT_KEYS.includes(key.toLowerCase()));
const outputTensorId = data.outputs[outputkey].slice(-1)[0];
const outputTensor = getValue(outputTensorId, output);
return outputTensor;
}; };
function getOutputShape () {
var outputTensor = getResult(modelType);
return outputTensor.shape;
}
// NCHW shape 2 NHWC shape
function nchwShape2nhwcShape(nchw) {
let batchNCHW = nchw;
if (nchw.length < 4) {
let batch = [];
for (let i = 0; i < (4 - nchw.length); i++) {
batch.push(1);
}
batchNCHW = batch.concat(nchw);
}
const N = batchNCHW[0];
const C = batchNCHW[1];
const H = batchNCHW[2];
const W = batchNCHW[3];
return [N, H, W, C];
}
/**
* file tools/logger logger工具
* author saniac(snailsword@gmail.com)
*/
export default class Logger {
constructor() {
this.timeTable = {};
this.countTable = {};
this.duringTable = {};
this.lastStopTable = {};
}
start(key) {
let arr = this.timeTable[key];
if (!arr) {
arr = [{}];
}
else {
if (!arr[arr.length - 1].endTime) {
console.error('[logger] key:' + key + ' duplicate start logger');
return;
}
arr.push({});
}
arr[arr.length - 1].startTime = this.time;
this.timeTable[key] = arr;
return this;
}
end(key) {
// console.log(this.timeTable[key]);
if (!this.timeTable[key]) {
console.log(this.timeTable[key]);
console.error('[logger] key:' + key + ' no matching start logger');
return;
}
let currentObj = this.timeTable[key][this.timeTable[key].length - 1];
if (currentObj.endTime) {
console.error('[logger] key:' + key + ' duplicate end logger');
return;
}
currentObj.endTime = this.time;
currentObj.during = currentObj.endTime - currentObj.startTime;
return this;
}
// 数次数
count(key) {
if (this.countTable[key]) {
this.countTable[key]++;
}
else {
this.countTable[key] = 1;
}
return this;
}
// 看每次执行的时间间隔
during(key) {
if (this.lastStopTable[key]) {
this.duringTable[key].push(this.time - this.lastStopTable[key]);
this.lastStopTable[key] = this.time;
}
else {
this.lastStopTable[key] = this.time;
this.duringTable[key] = [];
}
return this;
}
get time() {
return +new Date().getTime();
}
get statistics() {
// time
let timeResult = [];
let item;
for (let key in this.timeTable) {
item = this.timeTable[key];
let len = item.length;
let max = 0;
let min = Number.MAX_VALUE;
let sum = 0;
for (let i = 0; i < len; i++) {
max = Math.max(max, item[i].during);
min = Math.min(min, item[i].during);
sum += item[i].during;
}
timeResult.push({
name: key,
length: len,
avg: sum / len,
max,
min
});
}
console.table(timeResult);
return {timeResult};
}
}
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import json
import paddle.fluid as fluid
import paddle
import numpy as np
import collections
import math
import sys as sys
import os
import struct
#常量控制
#抽样打印数据数量
logDataCount = 50
# 输入模型所在目录
modelDir = "humanseg/"
# 输入模型名
modelName = "model"
# 输入参数名,当且仅当所有模型参数被保存在一个单独的二进制文件中,它才需要被指定,若为分片模型,请设置为None
paramsName = None
# 模型feed shape
inputShape = (1, 3, 192, 192)
# 输入数据
inputData = np.full(inputShape, 1, "float32")
# 输出模型目录
outputDir = "../dist/model/humanseg/"
# 权重分片扩展名
extensionName = ".dat"
# 输出各var数据
outputVarData = False
# 确认fluid的版本号
print(paddle.__version__)
# 采样输出list数据,采样的个数logDataCount为常量
def stridePrint1(data):
dataCount = len(data)
stride = math.floor(dataCount / logDataCount)
if stride == 0:
stride = 1
nums = []
# outputCount = logDataCount
# if dataCount < logDataCount:
# outputCount = dataCount
# for i in range(outputCount):
# # nums.append(str(i) + ": " + str(data[i]))
# nums.append(data[i])
for i in range(0, logDataCount):
item = data[i * stride]
nums.append(str(i * stride) + ": " + str(item))
print(nums)
def stridePrint(tensor):
length = len(tensor)
# if length < 3000:
# print(tensor)
# return
size = 20
stride = math.floor(length / size)
if stride == 0:
stride = 1
size = math.floor(length / stride)
nums = []
for i in range(0, size):
item = tensor[i * stride]
nums.append(str(i * stride) + ": " + str(item))
print(nums)
# 对字典进行排序,返回有序字典,默认升序
def sortDict(oldDict, reverse = False):
# 获得排序后的key list
keys = sorted(oldDict.keys(), reverse = reverse)
orderDict = collections.OrderedDict()
# 遍历 key 列表
for key in keys:
orderDict[key] = oldDict[key]
return orderDict
# 将权重数据分片输出到文件,默认分片策略为按4M分片
def sliceDataToBinaryFile(weightValueList, sliceMethod = 0):
# TODO: 分片这里不太对,待修改
totalWeightCount = len(weightValueList)
countPerSlice = 0
# sliceCount = 0
if sliceMethod == 0:
# 分片策略 0:按4M分片
countPerSlice = int(4 * 1024 * 1024 / 4)
# sliceCount = math.ceil(totalWeightCount / countPerSlice)
else:
# 分片策略 1:按<=4M等分
# TODO: 待实现
countPerSlice = 0
# sliceCount = 0
if not os.path.exists(outputDir):
os.makedirs(outputDir)
currentChunkIndex = 0
currentWeightIndex = 0
while currentWeightIndex < totalWeightCount - 1:
remainCount = totalWeightCount - currentWeightIndex
if remainCount < countPerSlice:
countPerSlice = remainCount
chunkPath = outputDir + 'chunk_%s' % (currentChunkIndex + 1) + extensionName
file = open(chunkPath, 'wb')
for i in weightValueList[currentWeightIndex : currentWeightIndex + countPerSlice]:
byte = struct.pack('f', float(i))
file.write(byte)
file.close()
currentWeightIndex = currentWeightIndex + countPerSlice
currentChunkIndex = currentChunkIndex + 1
# for debug
print("第" + str(currentChunkIndex + 1) + "片权重输出完毕,输出个数:" + str(countPerSlice) + " 剩余个数:" + str(totalWeightCount - currentWeightIndex))
# for debug
print("========权重输出完毕,共" + str(currentWeightIndex) + "个数据," + str(currentChunkIndex) + "个分片文件" + "========")
# 处理fluid的OP type与PaddleJS的OP type不对应情况
def mapToPaddleJSTypeName(fluidOPName):
if fluidOPName == "batch_norm":
return "batchnorm"
return fluidOPName
# 将shape扩充为4维
def padToFourDimShape(shape):
fourDimShape = []
if len(shape) == 4:
fourDimShape = shape
elif len(shape) < 4:
for i in range(0, 4 - len(shape)):
fourDimShape.append(1)
fourDimShape = fourDimShape + shape
else:
return []
return fourDimShape
# for debug,将NCHW排布的数据转为NHWC排布的数据
def convertNCHW2NHWC(data, shape):
fourDimShape = padToFourDimShape(shape)
N = fourDimShape[0]
C = fourDimShape[1]
H = fourDimShape[2]
W = fourDimShape[3]
print(fourDimShape)
HXW = H * W
CXHXW = C * H * W
index = 0
nhwcData = []
for n in range(0, N):
for h in range(0, H):
for w in range(0, W):
for c in range(0, C):
nhwcData.append(data[n * CXHXW + c * HXW + h * W + w])
index = index + 1
return nhwcData
# for debug 输出特定varName对应的数据
def writeTempOutputData(name):
# FIXME:待完善
return
dataList = np.array(fluid.global_scope().find_var(name).get_tensor()).flatten().tolist()
path = '/Users/bluebird/baidu/fluid_tools/check-temp/filter.txt'
if os.path.exists(path):
os.remove()
file = open(path,'a')
for a in range(0, len(dataList)):
file.write(str(dataList[a]))
file.write(",")
file.close()
def convertToPaddleJSModel():
# 1. 初始化fluid运行环境和配置
exe = fluid.Executor(fluid.CPUPlace())
[prog, feed_target_names, fetch_targets] = fluid.io.load_inference_model(dirname=modelDir, executor=exe, model_filename=modelName, params_filename=paramsName)
out = exe.run(prog, feed={feed_target_names[0]: inputData}, fetch_list=fetch_targets, return_numpy=False)
print(out)
index = 0
# 存放模型结构
modelInfo = {"vars": [], "ops": []}
# 存放var信息(未排序)
varInfoDict = {}
# 存放权重数值(未排序)
weightValueDict = {}
# 2. 获取program中所有的var,遍历并获取所有未排序的var信息和权重数值
vars = list(prog.list_vars())
for v in vars:
# 跳过feed和fetch
if "feed" == v.name:
continue
if "fetch" == v.name:
continue
print("Var index:" + str(index) + " name:" + v.name)
print(v)
index += 1
varShape = list(v.shape)
# FIXME:start paddlejs 不支持shape中为-1,这里需要手动过滤一下,支持了以后可以删除
varShapeExcludeNegativeOne = []
for s in varShape:
if s == -1:
continue
varShapeExcludeNegativeOne.append(s)
varShape = varShapeExcludeNegativeOne
# FIXME:end
# 存放variable信息,在dump成json时排序
varInfo = {}
varInfo["shape"] = varShape
# 数据是否是持久化数据,如weight为持久化数据,op的output不是持久化数据
# 只输出持久化数据,paddlejs中也仅读取持久化数据
varInfo["persistable"] = v.persistable
varInfoDict[v.name] = varInfo
# for debug,输出var变量
if outputVarData:
writeTempOutputData(v.name)
# persistable数据存入weightDict,等待排序
if v.persistable:
data = np.array(fluid.global_scope().find_var(v.name).get_tensor()).flatten().tolist()
weightValueDict[v.name] = data
# 3. 对var信息dict,按照key(var名)进行字母顺序排序
varInfoOrderDict = sortDict(varInfoDict)
# 4. 将var信息按照顺序,添加到model info的vars中
for key, value in varInfoOrderDict.items():
value["name"] = key
modelInfo["vars"].append(value)
# 5. 对权重数值dict,按照key(权重名)进行字母顺序排序,并组合到一起
weightValueOrderDict = sortDict(weightValueDict)
weightValues = []
for key, value in weightValueOrderDict.items():
weightValues += value
# 6. 分片输出权重
sliceDataToBinaryFile(weightValues)
# 7. 获取program中所有的op,按op顺序加入到model info
ops = prog.current_block().ops
feedOutputName = None
for op in ops:
opInfo = {}
# 获取OP type,需要映射到PaddleJS的名字
opInfo["type"] = mapToPaddleJSTypeName(op.type)
# 获取OP input
inputs = {}
for name in op.input_names:
value = op.input(name)
if len(value) <= 0:
continue
if value[0] == feedOutputName:
# FIXME:workaround,PaddleJSfeed 输入必须是image,且为单输入
# 这里修改feed后面的OP的input为image,建立前后关联
# 这里可能会有问题
inputs[name] = ["image"]
else:
inputs[name] = value
opInfo["inputs"] = inputs
# 获取OP output
outputs = {}
for name in op.output_names:
value = op.output(name)
if len(value) <= 0:
continue
if op.type == "feed":
# FIXME:workaround,PaddleJSfeed 输入必须是image,且为单输入
# 这里可能会有问题
feedOutputName = value[0]
outputs[name] = ["image"]
else:
outputs[name] = value
opInfo["outputs"] = outputs
# 获取OP attribute
attrs = {}
for name in op.attr_names:
# 过滤不需要的参数
if name in ["op_callstack", 'col', 'op_role', 'op_namescope', 'op_role_var']:
continue
value = op.attr(name)
attrs[name] = value
opInfo["attrs"] = attrs
# 存入modelInfo
modelInfo["ops"].append(opInfo)
# 8. 模型信息按照key字母顺序导出到json
outputModelPath = outputDir + "model.json"
with open(outputModelPath, 'w') as outputFile:
json.dump(modelInfo, outputFile, indent = 4, separators=(", ", ": "), sort_keys = True)
print("========模型结构输出完毕========")
convertToPaddleJSModel()
/**
* @file 打包到rd机器的配置
*/
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const extractLess = new ExtractTextPlugin({
filename: '[name].css'
});
module.exports = {
// mode: 'development',
mode: 'production',
devtool: 'none',
optimization: {
minimize: true
},
entry: {
index: ['./src/executor/runner']
},
output: {
filename: '../graphfe/dep/paddleweb/index.min.js',
path: path.resolve(__dirname, './'),
library: 'panorama',
libraryTarget: 'umd',
libraryExport: 'default'
},
module: {
rules: [{
test: /\.(es6|js)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: ['@babel/transform-runtime']
}
}
}, {
test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
loader: 'url-loader?limit=30000&name=[name].[ext]'
}, {
test: /\.less$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract([
{loader: 'css-loader', options: {minimize: true}},
{loader: 'less-loader'}
])
}]
},
plugins: [extractLess],
resolve: {
extensions: ['.es6', '.js', '.json']
}
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册