diff --git a/notebooks/convolutional/Cropping1D.ipynb b/notebooks/convolutional/Cropping1D.ipynb
new file mode 100644
index 0000000..bfec772
--- /dev/null
+++ b/notebooks/convolutional/Cropping1D.ipynb
@@ -0,0 +1,174 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:17:41.918185",
+ "start_time": "2016-11-15T10:17:41.915648"
+ },
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import numpy as np\n",
+ "from keras.models import Model\n",
+ "from keras.layers import Input\n",
+ "from keras.layers.convolutional import Cropping1D\n",
+ "from keras import backend as K"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:17:42.093433",
+ "start_time": "2016-11-15T10:17:42.091041"
+ },
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "def format_decimal(arr, places=6):\n",
+ " return [round(x * 10**places) / 10**places for x in arr]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Cropping1D"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping1D.0] cropping (1,1) on 6x4 input**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:20:10.543929",
+ "start_time": "2016-11-15T10:20:10.526160"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (6, 4)\n",
+ "in: [-0.412987, -0.139246, 0.567466, -0.512174, -0.33603, 0.585584, 0.453472, 0.942013, -0.609538, -0.894302, 0.711927, -0.126057, 0.677549, 0.676991, 0.471487, 0.752844, 0.218213, 0.37408, 0.09404, -0.786108, -0.1961, -0.031679, -0.188902, 0.846634]\n",
+ "out shape: (4, 4)\n",
+ "out: [-0.33603, 0.585584, 0.453472, 0.942013, -0.609538, -0.894302, 0.711927, -0.126057, 0.677549, 0.676991, 0.471487, 0.752844, 0.218213, 0.37408, 0.09404, -0.786108]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (6, 4)\n",
+ "L = Cropping1D(cropping=(1,1))\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(240)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping1D.1] cropping (2,3) on 6x4 input**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:19:26.401100",
+ "start_time": "2016-11-15T10:19:26.382981"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (6, 4)\n",
+ "in: [0.229895, 0.156613, -0.66952, -0.996975, 0.45773, 0.684298, -0.999213, 0.276751, -0.484373, -0.506163, 0.353904, 0.513668, -0.981594, 0.78914, 0.603978, 0.204066, 0.532874, 0.866766, -0.544852, 0.876693, -0.523052, -0.716556, 0.875262, 0.544879]\n",
+ "out shape: (1, 4)\n",
+ "out: [-0.484373, -0.506163, 0.353904, 0.513668]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (6, 4)\n",
+ "L = Cropping1D(cropping=(2,3))\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(241)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (with sys packages)",
+ "language": "python",
+ "name": "py3syspck"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/notebooks/convolutional/Cropping2D.ipynb b/notebooks/convolutional/Cropping2D.ipynb
new file mode 100644
index 0000000..de98279
--- /dev/null
+++ b/notebooks/convolutional/Cropping2D.ipynb
@@ -0,0 +1,289 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:05:43.575560",
+ "start_time": "2016-11-15T10:05:42.736839"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "Using TensorFlow backend.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from keras.models import Model\n",
+ "from keras.layers import Input\n",
+ "from keras.layers.convolutional import Cropping2D\n",
+ "from keras import backend as K"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:05:43.681603",
+ "start_time": "2016-11-15T10:05:43.678284"
+ },
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "def format_decimal(arr, places=6):\n",
+ " return [round(x * 10**places) / 10**places for x in arr]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Cropping2D"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping2D.0] cropping (1,1),(1, 1) on 3x5x4 input, dim_ordering=tf**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:06:18.618446",
+ "start_time": "2016-11-15T10:06:18.599690"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (3, 5, 4)\n",
+ "in: [-0.570441, -0.454673, -0.285321, 0.237249, 0.282682, 0.428035, 0.160547, -0.332203, 0.546391, 0.272735, 0.010827, -0.763164, -0.442696, 0.381948, -0.676994, 0.753553, -0.031788, 0.915329, -0.738844, 0.269075, 0.434091, 0.991585, -0.944288, 0.258834, 0.162138, 0.565201, -0.492094, 0.170854, -0.139788, -0.710674, 0.406968, 0.705926, -0.094137, -0.793497, -0.040684, 0.522292, 0.490496, -0.651771, 0.293113, -0.580922, -0.396436, 0.864522, -0.411659, 0.317379, 0.771844, 0.507235, 0.067782, 0.922641, -0.944205, 0.383713, -0.380187, -0.875176, 0.799314, -0.681818, -0.761323, 0.768315, -0.298568, -0.611688, -0.768656, 0.525693]\n",
+ "out shape: (1, 3, 4)\n",
+ "out: [0.162138, 0.565201, -0.492094, 0.170854, -0.139788, -0.710674, 0.406968, 0.705926, -0.094137, -0.793497, -0.040684, 0.522292]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (3, 5, 4)\n",
+ "L = Cropping2D(cropping=((1,1),(1, 1)), dim_ordering='tf')\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(250)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping2D.1] cropping (1,1),(1, 1) on 3x5x4 input, dim_ordering=th**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:06:23.116129",
+ "start_time": "2016-11-15T10:06:23.092950"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (3, 5, 4)\n",
+ "in: [-0.570441, -0.454673, -0.285321, 0.237249, 0.282682, 0.428035, 0.160547, -0.332203, 0.546391, 0.272735, 0.010827, -0.763164, -0.442696, 0.381948, -0.676994, 0.753553, -0.031788, 0.915329, -0.738844, 0.269075, 0.434091, 0.991585, -0.944288, 0.258834, 0.162138, 0.565201, -0.492094, 0.170854, -0.139788, -0.710674, 0.406968, 0.705926, -0.094137, -0.793497, -0.040684, 0.522292, 0.490496, -0.651771, 0.293113, -0.580922, -0.396436, 0.864522, -0.411659, 0.317379, 0.771844, 0.507235, 0.067782, 0.922641, -0.944205, 0.383713, -0.380187, -0.875176, 0.799314, -0.681818, -0.761323, 0.768315, -0.298568, -0.611688, -0.768656, 0.525693]\n",
+ "out shape: (3, 3, 2)\n",
+ "out: [0.428035, 0.160547, 0.272735, 0.010827, 0.381948, -0.676994, 0.565201, -0.492094, -0.710674, 0.406968, -0.793497, -0.040684, 0.507235, 0.067782, 0.383713, -0.380187, -0.681818, -0.761323]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (3, 5, 4)\n",
+ "L = Cropping2D(cropping=((1,1),(1, 1)), dim_ordering='th')\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(250)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping2D.2] cropping (4,2),(3,1) on 8x7x6 input, dim_ordering=tf**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:06:23.525520",
+ "start_time": "2016-11-15T10:06:23.501122"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (8, 7, 6)\n",
+ "in: [-0.989173, -0.133618, -0.505338, 0.023259, 0.503982, -0.303769, -0.436321, 0.793911, 0.416102, 0.806405, -0.098342, -0.738022, -0.982676, 0.805073, 0.741244, -0.941634, -0.253526, -0.136544, -0.295772, 0.207565, -0.517246, -0.686963, -0.176235, -0.354111, -0.862411, -0.969822, 0.200074, 0.290718, -0.038623, 0.294839, 0.247968, 0.557946, -0.455596, 0.6624, 0.879529, -0.466772, 0.40423, 0.213794, 0.645662, -0.044634, -0.552595, 0.771242, -0.131944, -0.172725, 0.700856, -0.001994, 0.606737, -0.593306, 0.898062, -0.203771, 0.645788, 0.596358, -0.571654, -0.636819, -0.367376, -0.892607, -0.123297, 0.748404, -0.783012, 0.061963, -0.908546, -0.988517, 0.97308, 0.483845, 0.967956, 0.95863, 0.633963, -0.109138, -0.615821, -0.479821, 0.42827, 0.761351, 0.108265, -0.835679, -0.200177, 0.556308, -0.346135, -0.591775, 0.888818, 0.088756, 0.887542, 0.231398, -0.062874, 0.379803, 0.248259, -0.004909, -0.694836, 0.246241, 0.576698, 0.877474, 0.353439, 0.528707, 0.585634, -0.985339, 0.438776, -0.314863, 0.784171, 0.12525, 0.889265, -0.644213, 0.052514, 0.733269, 0.099278, -0.141949, 0.498542, 0.735955, 0.760313, -0.660278, -0.604273, 0.199522, 0.346309, -0.488666, 0.706332, 0.995574, 0.234642, 0.042779, 0.583139, 0.159919, 0.104808, 0.232585, 0.625624, 0.748204, -0.878399, 0.514601, -0.392989, -0.835864, 0.247256, -0.889704, -0.776558, 0.069902, -0.982291, 0.139565, 0.559765, 0.364254, -0.167329, -0.027032, -0.396669, 0.887928, 0.24142, -0.950083, -0.354758, 0.815999, -0.533224, 0.001955, -0.997966, -0.716888, 0.861882, -0.883, 0.797625, 0.602008, -0.633245, -0.710132, 0.608369, -0.784398, 0.576564, 0.633279, 0.542795, 0.90345, 0.457414, 0.242734, 0.310622, -0.82517, 0.262998, -0.571046, 0.936527, 0.878469, -0.347791, -0.859749, -0.952931, -0.129702, 0.685477, -0.796418, 0.377681, 0.858414, -0.835134, 0.014816, 0.103085, 0.850919, -0.005764, 0.715943, 0.003942, 0.746505, -0.422674, 0.819656, 0.037147, 0.078259, 0.609219, 0.240121, -0.457013, -0.947625, -0.598543, 0.754378, 0.694688, 0.001741, -0.731877, -0.442437, 0.116966, 0.360755, 0.396709, 0.018889, -0.243222, 0.03233, 0.154516, 0.04915, 0.942633, -0.225662, 0.778155, 0.927135, -0.298936, -0.73013, -0.978144, -0.838932, 0.085808, -0.636771, -0.209125, 0.739682, 0.447976, -0.737185, 0.645007, -0.038338, -0.031764, -0.667117, -0.075763, 0.701876, 0.505738, 0.997181, -0.554428, -0.862689, 0.966555, 0.401094, -0.489316, 0.197598, 0.440944, 0.437652, -0.078096, 0.271921, 0.702964, -0.154695, 0.964746, 0.089738, -0.530063, -0.374368, -0.501949, -0.435823, -0.059041, 0.059762, 0.18368, -0.879219, -0.853283, 0.463376, 0.790678, -0.906068, -0.772338, 0.117419, 0.409168, 0.219139, -0.017059, 0.552391, 0.835856, -0.710045, 0.404615, -0.182959, -0.331881, -0.395508, -0.730692, 0.252354, 0.915251, -0.79357, 0.70079, -0.011832, -0.18324, 0.070365, 0.769189, 0.383026, -0.868293, 0.800455, 0.727587, -0.62417, -0.300598, -0.63724, -0.08886, 0.176103, 0.086305, -0.782202, -0.719459, -0.153585, -0.037527, 0.923902, 0.043134, -0.500307, -0.862448, -0.591515, 0.803712, 0.066251, -0.016947, 0.412293, -0.004009, 0.370996, -0.556311, -0.286518, -0.454324, 0.069928, -0.002182, -0.425322, 0.99516, 0.537532, 0.054711, 0.22533, -0.238724, 0.495853, 0.901436, 0.405811, -0.430268, -0.542533, -0.663813, -0.007121, 0.462074, -0.349408, 0.257701, 0.493632, -0.674434, -0.235252, 0.039342, 0.166896, 0.724501, 0.41962, -0.566634, 0.811497, 0.614648, -0.109631, -0.830493, -0.022923, -0.890479, 0.487839, 0.967617, 0.629215]\n",
+ "out shape: (2, 3, 6)\n",
+ "out: [0.609218, 0.240121, -0.457013, -0.947625, -0.598543, 0.754378, 0.694688, 0.001741, -0.731877, -0.442437, 0.116966, 0.360755, 0.396709, 0.018889, -0.243222, 0.03233, 0.154516, 0.04915, 0.966555, 0.401094, -0.489316, 0.197598, 0.440944, 0.437652, -0.078096, 0.271921, 0.702964, -0.154695, 0.964746, 0.089738, -0.530063, -0.374368, -0.501949, -0.435823, -0.059041, 0.059762]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (8, 7, 6)\n",
+ "L = Cropping2D(cropping=((4,2),(3,1)), dim_ordering='tf')\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(252)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping2D.3] cropping (4,2),(3,1) on 8x7x6 input, dim_ordering=th**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:06:23.828740",
+ "start_time": "2016-11-15T10:06:23.813107"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (8, 7, 6)\n",
+ "in: [-0.989173, -0.133618, -0.505338, 0.023259, 0.503982, -0.303769, -0.436321, 0.793911, 0.416102, 0.806405, -0.098342, -0.738022, -0.982676, 0.805073, 0.741244, -0.941634, -0.253526, -0.136544, -0.295772, 0.207565, -0.517246, -0.686963, -0.176235, -0.354111, -0.862411, -0.969822, 0.200074, 0.290718, -0.038623, 0.294839, 0.247968, 0.557946, -0.455596, 0.6624, 0.879529, -0.466772, 0.40423, 0.213794, 0.645662, -0.044634, -0.552595, 0.771242, -0.131944, -0.172725, 0.700856, -0.001994, 0.606737, -0.593306, 0.898062, -0.203771, 0.645788, 0.596358, -0.571654, -0.636819, -0.367376, -0.892607, -0.123297, 0.748404, -0.783012, 0.061963, -0.908546, -0.988517, 0.97308, 0.483845, 0.967956, 0.95863, 0.633963, -0.109138, -0.615821, -0.479821, 0.42827, 0.761351, 0.108265, -0.835679, -0.200177, 0.556308, -0.346135, -0.591775, 0.888818, 0.088756, 0.887542, 0.231398, -0.062874, 0.379803, 0.248259, -0.004909, -0.694836, 0.246241, 0.576698, 0.877474, 0.353439, 0.528707, 0.585634, -0.985339, 0.438776, -0.314863, 0.784171, 0.12525, 0.889265, -0.644213, 0.052514, 0.733269, 0.099278, -0.141949, 0.498542, 0.735955, 0.760313, -0.660278, -0.604273, 0.199522, 0.346309, -0.488666, 0.706332, 0.995574, 0.234642, 0.042779, 0.583139, 0.159919, 0.104808, 0.232585, 0.625624, 0.748204, -0.878399, 0.514601, -0.392989, -0.835864, 0.247256, -0.889704, -0.776558, 0.069902, -0.982291, 0.139565, 0.559765, 0.364254, -0.167329, -0.027032, -0.396669, 0.887928, 0.24142, -0.950083, -0.354758, 0.815999, -0.533224, 0.001955, -0.997966, -0.716888, 0.861882, -0.883, 0.797625, 0.602008, -0.633245, -0.710132, 0.608369, -0.784398, 0.576564, 0.633279, 0.542795, 0.90345, 0.457414, 0.242734, 0.310622, -0.82517, 0.262998, -0.571046, 0.936527, 0.878469, -0.347791, -0.859749, -0.952931, -0.129702, 0.685477, -0.796418, 0.377681, 0.858414, -0.835134, 0.014816, 0.103085, 0.850919, -0.005764, 0.715943, 0.003942, 0.746505, -0.422674, 0.819656, 0.037147, 0.078259, 0.609219, 0.240121, -0.457013, -0.947625, -0.598543, 0.754378, 0.694688, 0.001741, -0.731877, -0.442437, 0.116966, 0.360755, 0.396709, 0.018889, -0.243222, 0.03233, 0.154516, 0.04915, 0.942633, -0.225662, 0.778155, 0.927135, -0.298936, -0.73013, -0.978144, -0.838932, 0.085808, -0.636771, -0.209125, 0.739682, 0.447976, -0.737185, 0.645007, -0.038338, -0.031764, -0.667117, -0.075763, 0.701876, 0.505738, 0.997181, -0.554428, -0.862689, 0.966555, 0.401094, -0.489316, 0.197598, 0.440944, 0.437652, -0.078096, 0.271921, 0.702964, -0.154695, 0.964746, 0.089738, -0.530063, -0.374368, -0.501949, -0.435823, -0.059041, 0.059762, 0.18368, -0.879219, -0.853283, 0.463376, 0.790678, -0.906068, -0.772338, 0.117419, 0.409168, 0.219139, -0.017059, 0.552391, 0.835856, -0.710045, 0.404615, -0.182959, -0.331881, -0.395508, -0.730692, 0.252354, 0.915251, -0.79357, 0.70079, -0.011832, -0.18324, 0.070365, 0.769189, 0.383026, -0.868293, 0.800455, 0.727587, -0.62417, -0.300598, -0.63724, -0.08886, 0.176103, 0.086305, -0.782202, -0.719459, -0.153585, -0.037527, 0.923902, 0.043134, -0.500307, -0.862448, -0.591515, 0.803712, 0.066251, -0.016947, 0.412293, -0.004009, 0.370996, -0.556311, -0.286518, -0.454324, 0.069928, -0.002182, -0.425322, 0.99516, 0.537532, 0.054711, 0.22533, -0.238724, 0.495853, 0.901436, 0.405811, -0.430268, -0.542533, -0.663813, -0.007121, 0.462074, -0.349408, 0.257701, 0.493632, -0.674434, -0.235252, 0.039342, 0.166896, 0.724501, 0.41962, -0.566634, 0.811497, 0.614648, -0.109631, -0.830493, -0.022923, -0.890479, 0.487839, 0.967617, 0.629215]\n",
+ "out shape: (8, 1, 2)\n",
+ "out: [0.290718, -0.038623, -0.479821, 0.42827, -0.488666, 0.706332, -0.784398, 0.576564, -0.442437, 0.116966, -0.154695, 0.964746, -0.63724, -0.08886, -0.235252, 0.039342]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (8, 7, 6)\n",
+ "L = Cropping2D(cropping=((4,2),(3,1)), dim_ordering='th')\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(252)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (with sys packages)",
+ "language": "python",
+ "name": "py3syspck"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/notebooks/convolutional/Cropping3D.ipynb b/notebooks/convolutional/Cropping3D.ipynb
new file mode 100644
index 0000000..5e7ba09
--- /dev/null
+++ b/notebooks/convolutional/Cropping3D.ipynb
@@ -0,0 +1,291 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:23:54.915740",
+ "start_time": "2016-11-15T10:23:54.178233"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "Using TensorFlow backend.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from keras.models import Model\n",
+ "from keras.layers import Input\n",
+ "from keras.layers.convolutional import Cropping3D\n",
+ "from keras import backend as K"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:23:54.919435",
+ "start_time": "2016-11-15T10:23:54.917091"
+ },
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "def format_decimal(arr, places=6):\n",
+ " return [round(x * 10**places) / 10**places for x in arr]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Cropping3D"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping3D.0] cropping ((1,1), (1,1), (1,1)) on 3x5x3x3 input, dim_ordering=tf**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:25:16.914056",
+ "start_time": "2016-11-15T10:25:16.898008"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (3, 5, 3, 3)\n",
+ "in: [-0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.617251, 0.334305, -0.351137, -0.642574, 0.108974, -0.993964, 0.051085, -0.372012, 0.843766, 0.088025, -0.598662, 0.789035, -0.971233, -0.917609, 0.10035, -0.993908, 0.001303, 0.151006, -0.222302, -0.462642, 0.318882, 0.910461, -0.951606, -0.628088, 0.858834, 0.18648, 0.005839, -0.976863, -0.602595, -0.907466, 0.537085, 0.254335, -0.624879, -0.26462, -0.597274, 0.717515, 0.933281, -0.928165, -0.664793, 0.350419, 0.604354, 0.134613, -0.170544, 0.287505, -0.342583, -0.908204, -0.055996, 0.686364, -0.877763, 0.666511, -0.333493, -0.283194, 0.764997, 0.702478, -0.495511, 0.451364, 0.945924, -0.238126, 0.146568, -0.281422, -0.379007, 0.914172, 0.337272, 0.175728, -0.945958, -0.727577, -0.133378, -0.069779, -0.952209, 0.237581, -0.244335, 0.838199, -0.187442, 0.255861, 0.28158, -0.60797, 0.992258, 0.16382, 0.240562, 0.353587, 0.300174, 0.216722, -0.422345, -0.239941, 0.354771, 0.567014, -0.085289, 0.751301, -0.255041, -0.656808, -0.220736, -0.275667, 0.568007, 0.251274, 0.888831, 0.976139, 0.040987, 0.474905, 0.181267, 0.707542, -0.570195, 0.897656, -0.91601, -0.419443, -0.346422, -0.770603, 0.883902, -0.490007, 0.470248, -0.217687, 0.365399]\n",
+ "out shape: (1, 3, 1, 3)\n",
+ "out: [-0.26462, -0.597274, 0.717515, -0.170544, 0.287505, -0.342583, -0.283194, 0.764997, 0.702478]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (3, 5, 3, 3)\n",
+ "L = Cropping3D(cropping=((1,1), (1,1), (1,1)), dim_ordering='tf')\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(260)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping3D.1] cropping ((1,1), (1,1), (1,1)) on 3x5x3x3 input, dim_ordering=th**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:32:51.809434",
+ "start_time": "2016-11-15T10:32:51.786296"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (3, 5, 3, 3)\n",
+ "in: [-0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.617251, 0.334305, -0.351137, -0.642574, 0.108974, -0.993964, 0.051085, -0.372012, 0.843766, 0.088025, -0.598662, 0.789035, -0.971233, -0.917609, 0.10035, -0.993908, 0.001303, 0.151006, -0.222302, -0.462642, 0.318882, 0.910461, -0.951606, -0.628088, 0.858834, 0.18648, 0.005839, -0.976863, -0.602595, -0.907466, 0.537085, 0.254335, -0.624879, -0.26462, -0.597274, 0.717515, 0.933281, -0.928165, -0.664793, 0.350419, 0.604354, 0.134613, -0.170544, 0.287505, -0.342583, -0.908204, -0.055996, 0.686364, -0.877763, 0.666511, -0.333493, -0.283194, 0.764997, 0.702478, -0.495511, 0.451364, 0.945924, -0.238126, 0.146568, -0.281422, -0.379007, 0.914172, 0.337272, 0.175728, -0.945958, -0.727577, -0.133378, -0.069779, -0.952209, 0.237581, -0.244335, 0.838199, -0.187442, 0.255861, 0.28158, -0.60797, 0.992258, 0.16382, 0.240562, 0.353587, 0.300174, 0.216722, -0.422345, -0.239941, 0.354771, 0.567014, -0.085289, 0.751301, -0.255041, -0.656808, -0.220736, -0.275667, 0.568007, 0.251274, 0.888831, 0.976139, 0.040987, 0.474905, 0.181267, 0.707542, -0.570195, 0.897656, -0.91601, -0.419443, -0.346422, -0.770603, 0.883902, -0.490007, 0.470248, -0.217687, 0.365399]\n",
+ "out shape: (3, 3, 1, 1)\n",
+ "out: [-0.700858, -0.90685, -0.372012, -0.597274, 0.287505, 0.764997, 0.353587, -0.255041, 0.474905]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (3, 5, 3, 3)\n",
+ "L = Cropping3D(cropping=((1,1), (1,1), (1,1)), dim_ordering='th')\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(260)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping3D.2] cropping (3,2), (2,1), (2,3)) on 7x6x6x6 input, dim_ordering=tf**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:33:43.754762",
+ "start_time": "2016-11-15T10:33:43.728485"
+ },
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (7, 6, 6, 6)\n",
+ "in: [-0.215694, 0.441215, 0.116911, 0.53299, 0.883562, -0.535525, -0.869764, -0.596287, 0.576428, -0.689083, -0.132924, -0.129935, -0.17672, -0.29097, 0.590914, 0.992098, 0.908965, -0.170202, 0.640203, 0.178644, 0.866749, -0.545566, -0.827072, 0.420342, -0.076191, 0.207686, -0.908472, -0.795307, -0.948319, 0.683682, -0.563278, -0.82135, 0.391356, 0.873557, 0.101774, 0.552487, -0.805471, -0.158387, 0.737777, 0.407663, 0.024323, 0.931444, -0.813418, -0.054911, -0.8488, -0.528392, 0.31073, -0.518975, -0.334317, 0.984459, 0.876118, 0.939272, -0.286813, -0.499695, 0.741409, 0.979405, 0.384731, -0.861441, 0.956879, 0.371096, 0.395767, -0.182768, -0.04864, 0.943523, 0.252702, -0.922957, 0.084044, -0.151514, -0.104476, -0.519114, 0.170185, -0.304221, 0.648458, 0.975786, -0.026504, 0.806763, -0.551306, 0.363744, -0.253539, 0.520681, -0.555914, 0.164078, 0.069617, 0.61564, -0.814065, 0.834879, 0.448904, 0.572477, -0.634663, -0.962277, -0.511182, 0.28331, 0.456662, 0.097291, -0.612782, 0.780788, 0.815368, -0.045092, -0.154594, -0.749131, -0.13425, 0.067759, 0.965334, -0.402963, -0.305027, 0.900762, -0.68091, -0.760497, -0.702999, -0.479565, 0.705878, 0.739556, 0.743407, -0.08787, 0.194838, 0.444586, -0.237847, 0.714397, 0.003476, 0.176333, 0.318089, -0.210574, 0.665183, -0.74621, -0.439604, -0.032897, -0.67171, 0.757381, -0.117032, -0.832812, 0.562207, -0.824057, 0.147708, 0.608499, 0.377938, -0.930702, 0.04294, -0.039472, -0.517352, -0.64207, 0.361295, -0.544495, 0.825223, 0.473357, -0.733994, -0.368548, 0.586403, -0.465342, 0.72613, -0.187859, 0.054425, 0.239031, 0.854588, 0.829812, 0.848903, 0.139064, 0.008025, -0.546984, 0.395519, -0.866557, 0.801336, -0.732569, -0.185929, 0.152884, -0.953483, 0.930523, -0.54922, -0.093218, 0.325075, -0.719152, -0.633034, -0.753904, 0.344891, -0.963772, -0.446026, 0.286814, 0.756519, 0.372178, 0.071732, -0.188247, 0.693894, -0.43033, -0.903031, -0.492189, 0.899836, -0.552368, -0.553622, -0.679484, 0.016195, 0.891604, 0.779606, 0.149406, 0.752016, -0.695177, -0.930224, -0.664835, -0.79635, 0.423615, -0.254402, 0.159415, -0.15244, 0.820635, 0.770241, 0.815006, -0.485857, 0.294987, 0.964034, 0.134613, 0.673378, -0.376272, -0.808101, 0.412723, 0.573529, 0.005777, -0.053066, -0.700318, 0.235987, -0.068263, 0.247649, -0.404731, 0.203814, -0.329107, -0.468369, 0.802557, 0.66231, -0.149117, -0.138193, -0.101905, -0.035625, -0.443804, -0.78221, -0.073352, 0.550544, 0.364402, 0.969535, -0.108104, -0.87979, -0.49984, 0.412514, -0.689554, -0.126264, -0.471823, -0.446719, -0.720356, 0.457369, 0.985619, 0.607835, 0.48972, -0.515463, -0.124945, -0.114273, 0.005033, 0.791923, 0.351923, -0.290373, -0.951029, 0.913971, -0.539169, -0.028312, -0.036768, -0.850635, -0.167548, -0.168993, -0.923405, 0.853735, -0.154032, 0.30117, -0.244491, 0.191919, -0.825866, 0.634476, -0.098177, 0.365853, -0.976385, -0.992225, -0.707116, 0.487679, 0.0492, -0.463333, -0.173074, 0.83129, -0.141277, -0.806725, -0.935533, 0.843659, 0.476078, -0.071665, 0.159787, -0.917204, -0.54939, 0.593851, -0.599885, 0.524063, 0.326937, -0.238377, 0.097153, 0.343496, -0.58839, 0.830905, 0.442858, 0.462174, 0.705181, 0.048056, -0.938781, 0.653592, -0.730406, -0.929912, 0.897714, -0.735706, -0.410101, -0.955015, -0.001601, 0.085032, -0.055787, -0.944858, -0.793914, 0.000563, -0.16397, 0.33181, -0.289269, 0.10943, 0.944269, -0.193446, 0.48286, -0.195952, -0.511226, -0.448196, 0.695966, -0.12916, -0.713753, -0.64093, 0.716985, -0.098099, 0.123401, -0.056109, 0.010111, 0.352437, -0.509194, 0.750921, 0.253841, -0.708165, 0.821124, 0.006613, 0.098428, -0.78475, -0.60798, -0.947196, 0.282283, -0.262235, 0.53522, -0.864729, -0.119298, 0.936872, 0.180087, 0.977898, -0.025644, -0.558908, 0.715291, 0.000521, -0.764904, 0.319351, 0.980566, -0.786352, -0.532971, 0.22349, -0.716549, -0.310122, -0.487408, -0.440706, 0.977597, 0.983465, 0.234706, -0.604104, -0.965578, -0.580777, -0.791097, -0.091303, 0.973252, -0.612431, -0.843771, 0.759226, -0.496212, -0.798771, 0.088759, -0.344253, 0.431093, -0.794068, -0.225465, 0.339765, 0.130517, -0.512642, -0.109772, -0.90458, 0.404718, 0.704574, 0.758276, 0.659395, 0.443485, 0.506577, -0.883215, 0.828717, -0.532839, -0.743989, -0.561542, 0.237909, -0.11387, 0.580675, 0.939269, 0.922755, -0.262718, 0.345844, 0.690802, -0.151282, 0.655477, 0.035601, 0.611308, -0.530814, -0.8206, -0.524242, -0.493136, -0.074615, -0.412433, -0.082067, -0.188891, 0.788821, -0.264136, -0.188681, -0.001166, -0.237385, 0.716098, -0.055445, 0.903261, -0.690342, 0.345747, -0.8422, 0.681083, -0.880773, -0.47829, -0.087262, 0.286764, -0.73948, 0.938692, -0.734384, 0.836267, 0.428397, -0.284466, 0.087184, 0.565192, -0.92756, -0.617862, -0.902012, -0.97077, -0.3262, -0.117703, 0.324541, 0.790994, 0.960735, 0.858284, 0.35247, 0.199395, -0.886025, -0.403741, 0.286867, -0.745825, -0.575954, 0.393387, 0.161558, 0.933436, -0.04139, 0.712661, -0.621411, -0.704434, 0.374135, -0.71425, 0.502797, 0.034642, 0.633788, -0.449388, -0.593975, 0.805345, -0.399393, 0.518122, -0.382023, -0.698987, 0.925711, -0.808321, 0.670118, -0.306688, 0.038679, -0.880873, -0.105844, -0.335898, 0.321574, 0.976045, 0.664659, 0.341049, -0.813552, -0.181204, -0.457684, -0.944205, 0.130818, 0.91465, 0.375795, -0.83426, -0.884669, 0.884202, 0.524805, 0.866177, 0.605792, -0.143796, -0.468536, -0.848138, -0.471953, -0.958303, 0.221358, -0.120887, -0.368682, -0.346116, -0.182678, -0.569586, 0.328268, 0.744066, -0.089028, -0.413939, 0.966069, 0.806133, 0.811337, -0.216864, 0.519711, 0.532548, 0.782122, -0.594866, -0.414185, -0.96614, 0.504274, 0.770258, -0.81789, -0.441714, -0.43652, 0.582823, 0.838065, -0.213008, -0.643435, 0.230493, -0.679991, -0.179979, -0.931999, -0.154311, 0.96013, -0.202379, 0.473898, 0.401901, 0.485608, 0.835172, 0.767556, -0.318512, 0.869208, 0.091651, -0.450239, 0.921468, 0.980922, 0.874128, -0.457308, -0.78107, -0.604558, -0.107902, -0.868826, 0.761486, 0.985782, 0.18808, 0.034727, -0.51135, 0.007318, -0.412556, -0.575671, 0.262399, -0.431255, 0.236753, 0.234476, -0.009731, -0.469543, 0.335344, -0.006414, 0.127297, -0.300389, 0.608195, -0.556598, 0.611592, 0.828308, 0.66101, 0.139477, -0.559037, -0.34807, 0.920787, 0.967347, 0.615015, -0.182736, 0.942934, -0.622099, 0.944364, -0.700525, 0.283057, 0.214233, -0.352612, -0.391157, -0.6866, -0.949089, -0.830036, 0.028655, 0.160321, 0.962427, 0.771235, 0.701332, -0.073448, -0.880306, -0.67372, 0.579104, 0.832739, -0.451863, 0.830591, -0.393846, -0.87822, 0.432681, -0.222904, -0.855099, -0.703505, -0.723594, -0.401981, -0.304913, -0.60108, -0.207273, -0.259013, 0.065798, 0.244318, 0.518287, -0.047123, 0.769841, -0.833204, -0.936774, 0.74598, -0.557437, -0.221576, -0.913191, 0.108353, 0.115733, 0.013277, 0.439679, 0.422073, 0.303912, -0.021176, -0.91273, -0.909738, 0.559815, 0.621811, 0.907303, 0.34733, -0.143574, -0.215208, -0.919455, 0.860239, 0.041072, -0.011693, -0.787824, 0.551498, 0.966032, -0.763429, 0.548998, 0.155827, -0.539245, -0.508795, -0.076923, -0.430267, -0.026247, 0.110006, 0.050526, 0.312362, -0.29318, -0.913974, -0.018903, 0.348191, 0.43283, -0.339458, 0.67296, -0.503704, -0.126925, 0.126921, 0.681079, -0.18157, -0.846449, 0.561337, -0.162773, 0.578579, 0.845398, -0.535639, 0.928576, -0.333678, 0.755441, 0.76015, 0.329895, 0.144662, -0.208612, -0.298499, 0.978054, 0.087719, 0.56864, 0.791894, 0.633447, -0.829405, 0.696793, 0.844902, 0.639941, 0.855367, -0.563831, 0.11538, -0.838183, -0.340807, -0.765973, -0.201738, 0.901256, 0.461485, -0.922959, -0.543252, 0.247037, -0.603098, 0.143447, -0.298636, 0.255228, 0.555237, -0.142739, 0.094639, -0.003793, 0.585846, 0.795219, -0.16835, -0.51469, 0.478591, -0.749477, 0.155347, 0.706903, 0.047964, 0.239316, 0.790049, 0.707638, -0.367523, -0.852255, 0.309914, 0.848387, -0.859448, -0.273302, -0.337586, 0.048332, 0.927994, 0.564126, 0.254753, -0.573478, -0.346197, -0.715717, -0.051958, -0.494504, 0.599351, 0.984027, 0.23743, 0.854292, 0.20021, 0.100571, -0.407464, 0.395228, 0.987905, 0.195573, 0.58147, 0.06667, 0.854165, 0.416721, 0.034649, 0.241931, -0.819904, -0.738848, 0.008158, -0.725937, 0.478754, 0.883892, -0.11895, 0.422474, 0.755278, -0.107855, 0.893582, -0.656121, 0.169792, 0.026624, -0.854244, 0.043245, 0.013092, 0.906277, 0.050616, 0.137537, 0.123879, -0.829904, -0.8344, -0.500271, 0.187797, 0.480912, 0.689756, 0.648658, 0.112738, 0.480717, 0.050545, -0.517454, 0.646335, -0.520894, 0.298304, 0.00373, 0.176349, -0.112375, -0.844539, -0.292901, 0.027739, 0.113266, 0.867302, 0.893293, 0.951617, 0.858295, 0.403715, -0.694067, 0.018322, 0.604787, 0.904331, -0.877118, -0.381556, 0.302968, -0.884946, 0.634482, 0.2684, 0.07795, -0.552023, -0.497385, -0.001392, 0.613874, 0.312707, -0.516964, 0.07461, -0.532681, 0.097518, 0.018129, -0.312512, -0.860073, 0.318977, -0.744195, -0.150664, -0.53404, -0.428665, -0.174314, 0.247514, -0.595893, 0.748659, -0.37269, 0.780516, 0.655175, -0.511935, -0.747456, 0.111773, -0.309556, 0.636038, -0.256566, -0.724825, -0.316549, -0.868989, -0.706117, -0.824815, -0.618301, 0.856392, -0.996149, 0.63829, 0.880169, 0.893699, -0.893984, -0.046652, 0.315952, -0.44143, -0.864354, 0.892476, -0.211045, 0.059187, 0.57039, -0.997778, 0.191066, -0.830022, 0.650504, -0.530842, 0.058659, 0.952869, -0.157372, 0.92573, 0.928522, -0.45409, -0.778338, -0.363509, -0.763773, 0.679892, 0.241852, 0.351275, -0.258137, 0.395351, -0.381122, 0.709346, 0.375105, 0.28349, -0.151699, -0.887474, -0.980568, -0.84615, 0.90203, 0.770327, 0.159608, -0.959841, 0.784576, 0.545309, 0.493765, -0.27253, 0.655846, 0.553353, 0.152227, 0.438126, 0.987307, 0.403776, -0.232088, -0.605441, -0.090541, -0.189261, -0.999625, 0.538246, 0.532891, -0.374952, -0.508505, 0.346032, -0.344552, -0.550043, -0.935551, -0.99107, -0.301938, -0.168825, 0.35326, -0.599303, -0.654331, -0.261841, -0.571388, 0.698991, -0.078255, -0.195565, 0.691759, -0.628298, 0.697236, 0.670352, 0.110078, -0.137484, -0.965838, 0.499479, -0.931003, 0.565995, -0.289345, 0.171825, 0.893263, -0.698565, 0.106203, 0.78723, -0.507623, 0.23409, -0.072888, 0.972045, -0.156797, -0.18569, -0.816269, 0.086552, -0.862185, 0.977191, -0.818147, -0.917344, -0.578661, 0.216002, 0.390336, 0.227703, 0.962969, 0.885609, -0.2223, 0.669628, 0.042634, -0.939601, -0.949383, -0.383965, -0.42231, -0.374712, 0.387369, 0.646834, 0.872373, -0.217432, -0.860018, -0.730193, -0.842808, -0.088775, -0.45984, -0.641785, 0.361352, 0.617324, 0.281634, -0.267519, -0.104152, 0.065566, 0.638451, -0.99023, 0.122453, -0.581285, -0.84508, -0.213483, -0.018054, -0.2835, 0.951819, 0.731384, -0.241599, -0.941958, -0.47496, -0.704789, -0.267755, -0.299397, 0.475516, 0.224848, -0.613151, 0.853631, -0.285596, -0.984425, -0.004342, -0.558075, -0.498553, 0.272694, 0.068413, 0.598389, -0.558155, -0.463243, 0.118942, 0.392428, 0.585269, 0.559008, 0.509983, -0.719725, 0.899859, -0.054641, 0.56467, -0.088496, -0.246774, -0.909083, -0.635166, -0.180455, -0.566009, -0.304824, -0.337654, -0.28894, -0.930163, -0.180485, -0.515424, 0.710147, -0.606524, 0.985967, 0.888985, 0.645856, 0.745228, 0.442467, -0.309917, 0.726975, 0.019567, -0.140183, 0.614124, -0.856526, -0.568601, -0.90666, -0.746201, 0.89231, 0.328027, 0.670873, 0.772824, -0.249407, -0.225128, -0.309643, 0.055451, 0.397084, -0.015763, -0.104947, 0.946976, 0.373816, -0.485013, 0.004047, -0.892327, 0.812327, 0.013913, 0.817028, -0.083667, 0.727218, -0.856644, 0.181954, -0.947651, 0.517506, 0.385722, -0.222445, -0.129355, -0.155133, -0.186532, 0.134046, -0.181235, 0.701509, 0.10727, -0.223625, 0.990662, -0.071366, 0.751143, 0.855357, 0.084802, -0.832278, -0.053375, -0.19636, -0.903927, 0.513069, 0.618, -0.530257, 0.910113, -0.970662, 0.740255, -0.542166, 0.70816, 0.340971, 0.015036, -0.561873, -0.576902, 0.959876, -0.552993, 0.25889, -0.901, 0.269618, 0.946302, 0.943612, 0.326183, -0.988706, 0.354102, 0.675289, -0.567086, -0.11179, 0.792741, -0.225879, 0.084516, -0.663273, -0.006569, -0.602323, -0.837099, 0.090505, 0.058281, 0.048858, -0.123648, 0.270346, -0.663069, 0.261073, 0.202716, -0.108538, 0.08633, -0.588139, 0.245405, 0.370942, -0.920384, -0.283831, 0.181426, 0.215151, 0.286008, 0.068399, 0.495306, 0.582592, 0.961226, 0.388063, 0.164688, 0.940278, 0.246888, -0.365183, -0.985746, 0.680361, -0.70754, -0.638368, -0.194461, 0.012646, -0.833634, -0.946438, -0.317705, -0.936933, -0.114303, -0.200694, 0.869011, 0.605997, 0.160927, -0.226291, -0.443921, 0.170021, -0.678198, -0.008692, -0.866096, 0.473826, 0.008789, -0.907462, 0.227272, -0.774721, 0.275255, -0.17879, 0.297924, 0.190216, 0.796589, 0.564772, 0.676277, 0.347743, 0.993239, -0.800231, -0.825401, 0.604841, -0.078256, -0.981104, -0.590065, -0.690202, -0.140628, -0.281607, 0.13361, 0.487755, 0.703334, -0.048199, -0.729918, 0.638745, -0.930051, 0.792881, 0.560942, 0.984295, -0.026256, -0.807647, 0.037724, -0.883297, 0.527074, -0.058281, -0.343332, 0.832498, -0.823443, -0.868069, -0.665845, -0.68803, -0.204482, -0.56854, 0.589662, -0.68208, -0.711295, -0.324815, -0.363985, -0.141501, 0.180616, 0.098551, 0.356221, 0.76361, -0.495118, -0.619777, 0.267608, 0.089808, 0.008487, 0.674874, -0.490058, 0.251746, 0.422547, 0.257684, 0.125063, -0.211933, -0.5837, 0.899513, -0.843382, 0.809206, 0.015723, 0.099545, 0.847903, 0.857367, 0.519134, -0.417192, 0.941586, -0.080451, -0.848042, 0.211095, -0.772879, 0.89962, 0.423203, 0.512657, 0.319136, 0.45159, -0.624661, 0.753426, 0.435051, 0.529813, -0.230807, 0.888217, -0.166501, 0.465283, 0.651958, 0.519247, -0.225627, 0.382678, -0.629582, 0.551638, 0.929462, 0.314522, 0.614207, 0.823258, 0.56108, 0.86222, 0.19359, 0.244032, -0.378665, -0.005995, -0.292157, 0.168248, -0.429104, 0.014448, -0.882993, -0.234892, 0.514872, -0.502579, 0.118967, 0.07172, -0.850605, -0.607353, -0.138796, 0.331546, -0.847802, -0.932981, 0.084612, 0.010107, 0.32207, 0.801925, 0.997006, 0.326342, -0.226299, -0.748639, -0.730569, 0.262857, 0.413763, 0.066078, 0.089592, 0.27274, -0.05279, -0.45969, 0.459876, -0.440616, -0.584216, 0.786428, -0.973574, 0.061268, 0.092513, -0.567305, -0.81828, -0.918282, 0.664616, -0.575549, 0.971633, -0.982765, -0.632645, -0.800731, -0.21014, 0.826888, -0.155641, 0.144107, -0.920645, -0.991449, -0.000424, 0.300884, 0.1739, 0.015016, -0.977229, 0.095473, -0.747487, -0.04811, -0.136179, 0.468823, 0.927328, -0.555573, -0.527881, 0.645769, -0.477288, 0.346913, 0.293331, -0.322506, -0.486036, 0.944806, -0.511478, 0.899668, -0.303661, 0.873202, 0.723627, -0.538803, -0.541068, -0.667583, -0.461309, 0.929536, 0.935886, 0.219344, 0.039384, 0.043505, 0.921023, 0.774462, -0.165124, 0.534882, -0.491295, 0.64098, 0.91552, -0.657771, -0.558026, -0.790053, -0.191911, -0.308405, -0.04291, -0.448419, 0.21546, -0.242481, 0.808682, -0.01429, -0.20858, 0.441844, -0.943866, 0.320261, 0.523448, 0.585242, 0.090222, 0.800684, 0.112569, 0.30048, -0.66428, 0.752563, 0.22063, 0.918407, -0.76884, 0.825441, -0.044886, -0.039001, -0.828224, 0.433909, -0.700554, -0.84114, -0.65443, 0.292814, 0.275683, 0.124566, 0.551632, -0.010923, 0.678319, 0.628851, -0.458944, 0.800552, -0.397508, 0.98454, -0.965652, -0.20582, 0.820265, -0.132816, -0.278788, -0.856228, 0.139643, 0.703275, -0.322692, -0.338363, 0.378641, -0.28617, 0.101698, 0.433472, 0.068613, -0.148242, -0.466705, 0.738394, -0.410927, 0.984962, 0.405669, 0.125866, -0.982088, 0.955039, 0.845436, -0.745603, 0.446631, 0.78486, 0.369507, -0.380944, 0.883958, 0.268992, 0.106985, 0.97518, -0.222182, 0.831121, 0.946638, -0.357391, -0.347985, 0.787543, 0.209383, 0.476927, -0.374685, 0.693189, 0.60696, -0.978613, 0.289488, 0.943956, 0.035094, -0.89281, 0.105184, -0.666919, 0.304481, -0.955062, 0.925374, 0.157778, -0.468151, -0.31179, -0.012953, 0.164448, -0.656307, 0.343733]\n",
+ "out shape: (2, 3, 1, 6)\n",
+ "out: [0.795219, -0.16835, -0.51469, 0.478591, -0.749477, 0.155347, 0.195573, 0.58147, 0.06667, 0.854165, 0.416721, 0.034649, 0.480717, 0.050545, -0.517454, 0.646335, -0.520894, 0.298304, 0.691759, -0.628298, 0.697236, 0.670352, 0.110078, -0.137484, 0.042634, -0.939601, -0.949383, -0.383965, -0.42231, -0.374712, -0.267755, -0.299397, 0.475516, 0.224848, -0.613151, 0.853631]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (7, 6, 6, 6)\n",
+ "L = Cropping3D(cropping=((3,2), (2,1), (2,3)), dim_ordering='tf')\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(262)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**[convolutional.Cropping3D.3] cropping (3,2), (2,1), (2,3)) on 7x6x6x6 input, dim_ordering=th**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2016-11-15T10:34:42.856366",
+ "start_time": "2016-11-15T10:34:42.837264"
+ },
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "in shape: (7, 6, 6, 6)\n",
+ "in: [-0.215694, 0.441215, 0.116911, 0.53299, 0.883562, -0.535525, -0.869764, -0.596287, 0.576428, -0.689083, -0.132924, -0.129935, -0.17672, -0.29097, 0.590914, 0.992098, 0.908965, -0.170202, 0.640203, 0.178644, 0.866749, -0.545566, -0.827072, 0.420342, -0.076191, 0.207686, -0.908472, -0.795307, -0.948319, 0.683682, -0.563278, -0.82135, 0.391356, 0.873557, 0.101774, 0.552487, -0.805471, -0.158387, 0.737777, 0.407663, 0.024323, 0.931444, -0.813418, -0.054911, -0.8488, -0.528392, 0.31073, -0.518975, -0.334317, 0.984459, 0.876118, 0.939272, -0.286813, -0.499695, 0.741409, 0.979405, 0.384731, -0.861441, 0.956879, 0.371096, 0.395767, -0.182768, -0.04864, 0.943523, 0.252702, -0.922957, 0.084044, -0.151514, -0.104476, -0.519114, 0.170185, -0.304221, 0.648458, 0.975786, -0.026504, 0.806763, -0.551306, 0.363744, -0.253539, 0.520681, -0.555914, 0.164078, 0.069617, 0.61564, -0.814065, 0.834879, 0.448904, 0.572477, -0.634663, -0.962277, -0.511182, 0.28331, 0.456662, 0.097291, -0.612782, 0.780788, 0.815368, -0.045092, -0.154594, -0.749131, -0.13425, 0.067759, 0.965334, -0.402963, -0.305027, 0.900762, -0.68091, -0.760497, -0.702999, -0.479565, 0.705878, 0.739556, 0.743407, -0.08787, 0.194838, 0.444586, -0.237847, 0.714397, 0.003476, 0.176333, 0.318089, -0.210574, 0.665183, -0.74621, -0.439604, -0.032897, -0.67171, 0.757381, -0.117032, -0.832812, 0.562207, -0.824057, 0.147708, 0.608499, 0.377938, -0.930702, 0.04294, -0.039472, -0.517352, -0.64207, 0.361295, -0.544495, 0.825223, 0.473357, -0.733994, -0.368548, 0.586403, -0.465342, 0.72613, -0.187859, 0.054425, 0.239031, 0.854588, 0.829812, 0.848903, 0.139064, 0.008025, -0.546984, 0.395519, -0.866557, 0.801336, -0.732569, -0.185929, 0.152884, -0.953483, 0.930523, -0.54922, -0.093218, 0.325075, -0.719152, -0.633034, -0.753904, 0.344891, -0.963772, -0.446026, 0.286814, 0.756519, 0.372178, 0.071732, -0.188247, 0.693894, -0.43033, -0.903031, -0.492189, 0.899836, -0.552368, -0.553622, -0.679484, 0.016195, 0.891604, 0.779606, 0.149406, 0.752016, -0.695177, -0.930224, -0.664835, -0.79635, 0.423615, -0.254402, 0.159415, -0.15244, 0.820635, 0.770241, 0.815006, -0.485857, 0.294987, 0.964034, 0.134613, 0.673378, -0.376272, -0.808101, 0.412723, 0.573529, 0.005777, -0.053066, -0.700318, 0.235987, -0.068263, 0.247649, -0.404731, 0.203814, -0.329107, -0.468369, 0.802557, 0.66231, -0.149117, -0.138193, -0.101905, -0.035625, -0.443804, -0.78221, -0.073352, 0.550544, 0.364402, 0.969535, -0.108104, -0.87979, -0.49984, 0.412514, -0.689554, -0.126264, -0.471823, -0.446719, -0.720356, 0.457369, 0.985619, 0.607835, 0.48972, -0.515463, -0.124945, -0.114273, 0.005033, 0.791923, 0.351923, -0.290373, -0.951029, 0.913971, -0.539169, -0.028312, -0.036768, -0.850635, -0.167548, -0.168993, -0.923405, 0.853735, -0.154032, 0.30117, -0.244491, 0.191919, -0.825866, 0.634476, -0.098177, 0.365853, -0.976385, -0.992225, -0.707116, 0.487679, 0.0492, -0.463333, -0.173074, 0.83129, -0.141277, -0.806725, -0.935533, 0.843659, 0.476078, -0.071665, 0.159787, -0.917204, -0.54939, 0.593851, -0.599885, 0.524063, 0.326937, -0.238377, 0.097153, 0.343496, -0.58839, 0.830905, 0.442858, 0.462174, 0.705181, 0.048056, -0.938781, 0.653592, -0.730406, -0.929912, 0.897714, -0.735706, -0.410101, -0.955015, -0.001601, 0.085032, -0.055787, -0.944858, -0.793914, 0.000563, -0.16397, 0.33181, -0.289269, 0.10943, 0.944269, -0.193446, 0.48286, -0.195952, -0.511226, -0.448196, 0.695966, -0.12916, -0.713753, -0.64093, 0.716985, -0.098099, 0.123401, -0.056109, 0.010111, 0.352437, -0.509194, 0.750921, 0.253841, -0.708165, 0.821124, 0.006613, 0.098428, -0.78475, -0.60798, -0.947196, 0.282283, -0.262235, 0.53522, -0.864729, -0.119298, 0.936872, 0.180087, 0.977898, -0.025644, -0.558908, 0.715291, 0.000521, -0.764904, 0.319351, 0.980566, -0.786352, -0.532971, 0.22349, -0.716549, -0.310122, -0.487408, -0.440706, 0.977597, 0.983465, 0.234706, -0.604104, -0.965578, -0.580777, -0.791097, -0.091303, 0.973252, -0.612431, -0.843771, 0.759226, -0.496212, -0.798771, 0.088759, -0.344253, 0.431093, -0.794068, -0.225465, 0.339765, 0.130517, -0.512642, -0.109772, -0.90458, 0.404718, 0.704574, 0.758276, 0.659395, 0.443485, 0.506577, -0.883215, 0.828717, -0.532839, -0.743989, -0.561542, 0.237909, -0.11387, 0.580675, 0.939269, 0.922755, -0.262718, 0.345844, 0.690802, -0.151282, 0.655477, 0.035601, 0.611308, -0.530814, -0.8206, -0.524242, -0.493136, -0.074615, -0.412433, -0.082067, -0.188891, 0.788821, -0.264136, -0.188681, -0.001166, -0.237385, 0.716098, -0.055445, 0.903261, -0.690342, 0.345747, -0.8422, 0.681083, -0.880773, -0.47829, -0.087262, 0.286764, -0.73948, 0.938692, -0.734384, 0.836267, 0.428397, -0.284466, 0.087184, 0.565192, -0.92756, -0.617862, -0.902012, -0.97077, -0.3262, -0.117703, 0.324541, 0.790994, 0.960735, 0.858284, 0.35247, 0.199395, -0.886025, -0.403741, 0.286867, -0.745825, -0.575954, 0.393387, 0.161558, 0.933436, -0.04139, 0.712661, -0.621411, -0.704434, 0.374135, -0.71425, 0.502797, 0.034642, 0.633788, -0.449388, -0.593975, 0.805345, -0.399393, 0.518122, -0.382023, -0.698987, 0.925711, -0.808321, 0.670118, -0.306688, 0.038679, -0.880873, -0.105844, -0.335898, 0.321574, 0.976045, 0.664659, 0.341049, -0.813552, -0.181204, -0.457684, -0.944205, 0.130818, 0.91465, 0.375795, -0.83426, -0.884669, 0.884202, 0.524805, 0.866177, 0.605792, -0.143796, -0.468536, -0.848138, -0.471953, -0.958303, 0.221358, -0.120887, -0.368682, -0.346116, -0.182678, -0.569586, 0.328268, 0.744066, -0.089028, -0.413939, 0.966069, 0.806133, 0.811337, -0.216864, 0.519711, 0.532548, 0.782122, -0.594866, -0.414185, -0.96614, 0.504274, 0.770258, -0.81789, -0.441714, -0.43652, 0.582823, 0.838065, -0.213008, -0.643435, 0.230493, -0.679991, -0.179979, -0.931999, -0.154311, 0.96013, -0.202379, 0.473898, 0.401901, 0.485608, 0.835172, 0.767556, -0.318512, 0.869208, 0.091651, -0.450239, 0.921468, 0.980922, 0.874128, -0.457308, -0.78107, -0.604558, -0.107902, -0.868826, 0.761486, 0.985782, 0.18808, 0.034727, -0.51135, 0.007318, -0.412556, -0.575671, 0.262399, -0.431255, 0.236753, 0.234476, -0.009731, -0.469543, 0.335344, -0.006414, 0.127297, -0.300389, 0.608195, -0.556598, 0.611592, 0.828308, 0.66101, 0.139477, -0.559037, -0.34807, 0.920787, 0.967347, 0.615015, -0.182736, 0.942934, -0.622099, 0.944364, -0.700525, 0.283057, 0.214233, -0.352612, -0.391157, -0.6866, -0.949089, -0.830036, 0.028655, 0.160321, 0.962427, 0.771235, 0.701332, -0.073448, -0.880306, -0.67372, 0.579104, 0.832739, -0.451863, 0.830591, -0.393846, -0.87822, 0.432681, -0.222904, -0.855099, -0.703505, -0.723594, -0.401981, -0.304913, -0.60108, -0.207273, -0.259013, 0.065798, 0.244318, 0.518287, -0.047123, 0.769841, -0.833204, -0.936774, 0.74598, -0.557437, -0.221576, -0.913191, 0.108353, 0.115733, 0.013277, 0.439679, 0.422073, 0.303912, -0.021176, -0.91273, -0.909738, 0.559815, 0.621811, 0.907303, 0.34733, -0.143574, -0.215208, -0.919455, 0.860239, 0.041072, -0.011693, -0.787824, 0.551498, 0.966032, -0.763429, 0.548998, 0.155827, -0.539245, -0.508795, -0.076923, -0.430267, -0.026247, 0.110006, 0.050526, 0.312362, -0.29318, -0.913974, -0.018903, 0.348191, 0.43283, -0.339458, 0.67296, -0.503704, -0.126925, 0.126921, 0.681079, -0.18157, -0.846449, 0.561337, -0.162773, 0.578579, 0.845398, -0.535639, 0.928576, -0.333678, 0.755441, 0.76015, 0.329895, 0.144662, -0.208612, -0.298499, 0.978054, 0.087719, 0.56864, 0.791894, 0.633447, -0.829405, 0.696793, 0.844902, 0.639941, 0.855367, -0.563831, 0.11538, -0.838183, -0.340807, -0.765973, -0.201738, 0.901256, 0.461485, -0.922959, -0.543252, 0.247037, -0.603098, 0.143447, -0.298636, 0.255228, 0.555237, -0.142739, 0.094639, -0.003793, 0.585846, 0.795219, -0.16835, -0.51469, 0.478591, -0.749477, 0.155347, 0.706903, 0.047964, 0.239316, 0.790049, 0.707638, -0.367523, -0.852255, 0.309914, 0.848387, -0.859448, -0.273302, -0.337586, 0.048332, 0.927994, 0.564126, 0.254753, -0.573478, -0.346197, -0.715717, -0.051958, -0.494504, 0.599351, 0.984027, 0.23743, 0.854292, 0.20021, 0.100571, -0.407464, 0.395228, 0.987905, 0.195573, 0.58147, 0.06667, 0.854165, 0.416721, 0.034649, 0.241931, -0.819904, -0.738848, 0.008158, -0.725937, 0.478754, 0.883892, -0.11895, 0.422474, 0.755278, -0.107855, 0.893582, -0.656121, 0.169792, 0.026624, -0.854244, 0.043245, 0.013092, 0.906277, 0.050616, 0.137537, 0.123879, -0.829904, -0.8344, -0.500271, 0.187797, 0.480912, 0.689756, 0.648658, 0.112738, 0.480717, 0.050545, -0.517454, 0.646335, -0.520894, 0.298304, 0.00373, 0.176349, -0.112375, -0.844539, -0.292901, 0.027739, 0.113266, 0.867302, 0.893293, 0.951617, 0.858295, 0.403715, -0.694067, 0.018322, 0.604787, 0.904331, -0.877118, -0.381556, 0.302968, -0.884946, 0.634482, 0.2684, 0.07795, -0.552023, -0.497385, -0.001392, 0.613874, 0.312707, -0.516964, 0.07461, -0.532681, 0.097518, 0.018129, -0.312512, -0.860073, 0.318977, -0.744195, -0.150664, -0.53404, -0.428665, -0.174314, 0.247514, -0.595893, 0.748659, -0.37269, 0.780516, 0.655175, -0.511935, -0.747456, 0.111773, -0.309556, 0.636038, -0.256566, -0.724825, -0.316549, -0.868989, -0.706117, -0.824815, -0.618301, 0.856392, -0.996149, 0.63829, 0.880169, 0.893699, -0.893984, -0.046652, 0.315952, -0.44143, -0.864354, 0.892476, -0.211045, 0.059187, 0.57039, -0.997778, 0.191066, -0.830022, 0.650504, -0.530842, 0.058659, 0.952869, -0.157372, 0.92573, 0.928522, -0.45409, -0.778338, -0.363509, -0.763773, 0.679892, 0.241852, 0.351275, -0.258137, 0.395351, -0.381122, 0.709346, 0.375105, 0.28349, -0.151699, -0.887474, -0.980568, -0.84615, 0.90203, 0.770327, 0.159608, -0.959841, 0.784576, 0.545309, 0.493765, -0.27253, 0.655846, 0.553353, 0.152227, 0.438126, 0.987307, 0.403776, -0.232088, -0.605441, -0.090541, -0.189261, -0.999625, 0.538246, 0.532891, -0.374952, -0.508505, 0.346032, -0.344552, -0.550043, -0.935551, -0.99107, -0.301938, -0.168825, 0.35326, -0.599303, -0.654331, -0.261841, -0.571388, 0.698991, -0.078255, -0.195565, 0.691759, -0.628298, 0.697236, 0.670352, 0.110078, -0.137484, -0.965838, 0.499479, -0.931003, 0.565995, -0.289345, 0.171825, 0.893263, -0.698565, 0.106203, 0.78723, -0.507623, 0.23409, -0.072888, 0.972045, -0.156797, -0.18569, -0.816269, 0.086552, -0.862185, 0.977191, -0.818147, -0.917344, -0.578661, 0.216002, 0.390336, 0.227703, 0.962969, 0.885609, -0.2223, 0.669628, 0.042634, -0.939601, -0.949383, -0.383965, -0.42231, -0.374712, 0.387369, 0.646834, 0.872373, -0.217432, -0.860018, -0.730193, -0.842808, -0.088775, -0.45984, -0.641785, 0.361352, 0.617324, 0.281634, -0.267519, -0.104152, 0.065566, 0.638451, -0.99023, 0.122453, -0.581285, -0.84508, -0.213483, -0.018054, -0.2835, 0.951819, 0.731384, -0.241599, -0.941958, -0.47496, -0.704789, -0.267755, -0.299397, 0.475516, 0.224848, -0.613151, 0.853631, -0.285596, -0.984425, -0.004342, -0.558075, -0.498553, 0.272694, 0.068413, 0.598389, -0.558155, -0.463243, 0.118942, 0.392428, 0.585269, 0.559008, 0.509983, -0.719725, 0.899859, -0.054641, 0.56467, -0.088496, -0.246774, -0.909083, -0.635166, -0.180455, -0.566009, -0.304824, -0.337654, -0.28894, -0.930163, -0.180485, -0.515424, 0.710147, -0.606524, 0.985967, 0.888985, 0.645856, 0.745228, 0.442467, -0.309917, 0.726975, 0.019567, -0.140183, 0.614124, -0.856526, -0.568601, -0.90666, -0.746201, 0.89231, 0.328027, 0.670873, 0.772824, -0.249407, -0.225128, -0.309643, 0.055451, 0.397084, -0.015763, -0.104947, 0.946976, 0.373816, -0.485013, 0.004047, -0.892327, 0.812327, 0.013913, 0.817028, -0.083667, 0.727218, -0.856644, 0.181954, -0.947651, 0.517506, 0.385722, -0.222445, -0.129355, -0.155133, -0.186532, 0.134046, -0.181235, 0.701509, 0.10727, -0.223625, 0.990662, -0.071366, 0.751143, 0.855357, 0.084802, -0.832278, -0.053375, -0.19636, -0.903927, 0.513069, 0.618, -0.530257, 0.910113, -0.970662, 0.740255, -0.542166, 0.70816, 0.340971, 0.015036, -0.561873, -0.576902, 0.959876, -0.552993, 0.25889, -0.901, 0.269618, 0.946302, 0.943612, 0.326183, -0.988706, 0.354102, 0.675289, -0.567086, -0.11179, 0.792741, -0.225879, 0.084516, -0.663273, -0.006569, -0.602323, -0.837099, 0.090505, 0.058281, 0.048858, -0.123648, 0.270346, -0.663069, 0.261073, 0.202716, -0.108538, 0.08633, -0.588139, 0.245405, 0.370942, -0.920384, -0.283831, 0.181426, 0.215151, 0.286008, 0.068399, 0.495306, 0.582592, 0.961226, 0.388063, 0.164688, 0.940278, 0.246888, -0.365183, -0.985746, 0.680361, -0.70754, -0.638368, -0.194461, 0.012646, -0.833634, -0.946438, -0.317705, -0.936933, -0.114303, -0.200694, 0.869011, 0.605997, 0.160927, -0.226291, -0.443921, 0.170021, -0.678198, -0.008692, -0.866096, 0.473826, 0.008789, -0.907462, 0.227272, -0.774721, 0.275255, -0.17879, 0.297924, 0.190216, 0.796589, 0.564772, 0.676277, 0.347743, 0.993239, -0.800231, -0.825401, 0.604841, -0.078256, -0.981104, -0.590065, -0.690202, -0.140628, -0.281607, 0.13361, 0.487755, 0.703334, -0.048199, -0.729918, 0.638745, -0.930051, 0.792881, 0.560942, 0.984295, -0.026256, -0.807647, 0.037724, -0.883297, 0.527074, -0.058281, -0.343332, 0.832498, -0.823443, -0.868069, -0.665845, -0.68803, -0.204482, -0.56854, 0.589662, -0.68208, -0.711295, -0.324815, -0.363985, -0.141501, 0.180616, 0.098551, 0.356221, 0.76361, -0.495118, -0.619777, 0.267608, 0.089808, 0.008487, 0.674874, -0.490058, 0.251746, 0.422547, 0.257684, 0.125063, -0.211933, -0.5837, 0.899513, -0.843382, 0.809206, 0.015723, 0.099545, 0.847903, 0.857367, 0.519134, -0.417192, 0.941586, -0.080451, -0.848042, 0.211095, -0.772879, 0.89962, 0.423203, 0.512657, 0.319136, 0.45159, -0.624661, 0.753426, 0.435051, 0.529813, -0.230807, 0.888217, -0.166501, 0.465283, 0.651958, 0.519247, -0.225627, 0.382678, -0.629582, 0.551638, 0.929462, 0.314522, 0.614207, 0.823258, 0.56108, 0.86222, 0.19359, 0.244032, -0.378665, -0.005995, -0.292157, 0.168248, -0.429104, 0.014448, -0.882993, -0.234892, 0.514872, -0.502579, 0.118967, 0.07172, -0.850605, -0.607353, -0.138796, 0.331546, -0.847802, -0.932981, 0.084612, 0.010107, 0.32207, 0.801925, 0.997006, 0.326342, -0.226299, -0.748639, -0.730569, 0.262857, 0.413763, 0.066078, 0.089592, 0.27274, -0.05279, -0.45969, 0.459876, -0.440616, -0.584216, 0.786428, -0.973574, 0.061268, 0.092513, -0.567305, -0.81828, -0.918282, 0.664616, -0.575549, 0.971633, -0.982765, -0.632645, -0.800731, -0.21014, 0.826888, -0.155641, 0.144107, -0.920645, -0.991449, -0.000424, 0.300884, 0.1739, 0.015016, -0.977229, 0.095473, -0.747487, -0.04811, -0.136179, 0.468823, 0.927328, -0.555573, -0.527881, 0.645769, -0.477288, 0.346913, 0.293331, -0.322506, -0.486036, 0.944806, -0.511478, 0.899668, -0.303661, 0.873202, 0.723627, -0.538803, -0.541068, -0.667583, -0.461309, 0.929536, 0.935886, 0.219344, 0.039384, 0.043505, 0.921023, 0.774462, -0.165124, 0.534882, -0.491295, 0.64098, 0.91552, -0.657771, -0.558026, -0.790053, -0.191911, -0.308405, -0.04291, -0.448419, 0.21546, -0.242481, 0.808682, -0.01429, -0.20858, 0.441844, -0.943866, 0.320261, 0.523448, 0.585242, 0.090222, 0.800684, 0.112569, 0.30048, -0.66428, 0.752563, 0.22063, 0.918407, -0.76884, 0.825441, -0.044886, -0.039001, -0.828224, 0.433909, -0.700554, -0.84114, -0.65443, 0.292814, 0.275683, 0.124566, 0.551632, -0.010923, 0.678319, 0.628851, -0.458944, 0.800552, -0.397508, 0.98454, -0.965652, -0.20582, 0.820265, -0.132816, -0.278788, -0.856228, 0.139643, 0.703275, -0.322692, -0.338363, 0.378641, -0.28617, 0.101698, 0.433472, 0.068613, -0.148242, -0.466705, 0.738394, -0.410927, 0.984962, 0.405669, 0.125866, -0.982088, 0.955039, 0.845436, -0.745603, 0.446631, 0.78486, 0.369507, -0.380944, 0.883958, 0.268992, 0.106985, 0.97518, -0.222182, 0.831121, 0.946638, -0.357391, -0.347985, 0.787543, 0.209383, 0.476927, -0.374685, 0.693189, 0.60696, -0.978613, 0.289488, 0.943956, 0.035094, -0.89281, 0.105184, -0.666919, 0.304481, -0.955062, 0.925374, 0.157778, -0.468151, -0.31179, -0.012953, 0.164448, -0.656307, 0.343733]\n",
+ "out shape: (7, 1, 3, 1)\n",
+ "out: [0.665183, -0.117032, 0.377938, 0.750921, -0.78475, -0.864729, 0.767556, 0.980922, -0.868826, 0.06667, -0.738848, 0.422474, -0.949383, 0.872373, -0.45984, 0.275255, 0.676277, -0.078256, -0.943866, 0.112569, -0.76884]\n"
+ ]
+ }
+ ],
+ "source": [
+ "data_in_shape = (7, 6, 6, 6)\n",
+ "L = Cropping3D(cropping=((3,2), (2,1), (2,3)), dim_ordering='th')\n",
+ "\n",
+ "\n",
+ "layer_0 = Input(shape=data_in_shape)\n",
+ "layer_1 = L(layer_0)\n",
+ "model = Model(input=layer_0, output=layer_1)\n",
+ "\n",
+ "# set weights to random (use seed for reproducibility)\n",
+ "np.random.seed(262)\n",
+ "data_in = 2 * np.random.random(data_in_shape) - 1\n",
+ "print('')\n",
+ "print('in shape:', data_in_shape)\n",
+ "print('in:', format_decimal(data_in.ravel().tolist()))\n",
+ "result = model.predict(np.array([data_in]))\n",
+ "print('out shape:', result[0].shape)\n",
+ "print('out:', format_decimal(result[0].ravel().tolist()))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (with sys packages)",
+ "language": "python",
+ "name": "py3syspck"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/src/layers/convolutional/Cropping1D.js b/src/layers/convolutional/Cropping1D.js
new file mode 100644
index 0000000..0fe048f
--- /dev/null
+++ b/src/layers/convolutional/Cropping1D.js
@@ -0,0 +1,47 @@
+import Layer from '../../Layer'
+import Tensor from '../../Tensor'
+import ops from 'ndarray-ops'
+
+/**
+ * Cropping1D layer class
+ */
+export default class Cropping1D extends Layer {
+ /**
+ * Creates a Cropping1D activation layer
+ * @param {cropping} attrs.cropping - tuple of of int (length 2)
+ */
+ constructor (attrs = {}) {
+ super(attrs)
+ this.layerClass = 'Cropping1D'
+
+ const {
+ cropping = [0,0],
+ dimOrdering = 'tf'
+ } = attrs
+
+ this.cropping = cropping
+ this.dimOrdering = dimOrdering
+ }
+
+ /**
+ * Method for layer computational logic
+ * @param {Tensor} x
+ * @returns {Tensor} x
+ */
+ call (x) {
+ const inputShape = x.tensor.shape
+ const outputShape = [
+ inputShape[0] - this.cropping[0] - this.cropping[1],
+ inputShape[1]
+ ]
+ let y = new Tensor([], outputShape)
+ ops.assign(
+ y.tensor,
+ x.tensor
+ .hi(inputShape[0] - this.cropping[1], inputShape[2])
+ .lo(this.cropping[0], 0)
+ )
+ x.tensor = y.tensor
+ return x
+ }
+}
diff --git a/src/layers/convolutional/Cropping2D.js b/src/layers/convolutional/Cropping2D.js
new file mode 100644
index 0000000..1ac6d65
--- /dev/null
+++ b/src/layers/convolutional/Cropping2D.js
@@ -0,0 +1,59 @@
+import Layer from '../../Layer'
+import Tensor from '../../Tensor'
+import ops from 'ndarray-ops'
+
+/**
+ * Cropping2D layer class
+ */
+export default class Cropping2D extends Layer {
+ /**
+ * Creates a Cropping2D activation layer
+ * @param {cropping} attrs.cropping - tuple of tuple of int (length 2)
+ */
+ constructor (attrs = {}) {
+ super(attrs)
+ this.layerClass = 'Cropping2D'
+
+ const {
+ cropping = [[0,0], [0,0]],
+ dimOrdering = 'tf'
+ } = attrs
+
+ this.cropping = cropping
+ this.dimOrdering = dimOrdering
+ }
+
+ /**
+ * Method for layer computational logic
+ * @param {Tensor} x
+ * @returns {Tensor} x
+ */
+ call (x) {
+ // convert to tf ordering
+ if (this.dimOrdering === 'th') {
+ x.tensor = x.tensor.transpose(1, 2, 0)
+ }
+
+ const inputShape = x.tensor.shape
+ const outputShape = [
+ inputShape[0] - this.cropping[0][0] - this.cropping[0][1],
+ inputShape[1] - this.cropping[1][0] - this.cropping[1][1],
+ inputShape[2]
+ ]
+ let y = new Tensor([], outputShape)
+ ops.assign(
+ y.tensor,
+ x.tensor
+ .hi(inputShape[0] - this.cropping[0][1], inputShape[1] - this.cropping[1][1], inputShape[2])
+ .lo(this.cropping[0][0], this.cropping[1][0], 0)
+ )
+ x.tensor = y.tensor
+
+ // convert back to th ordering if necessary
+ if (this.dimOrdering === 'th') {
+ x.tensor = x.tensor.transpose(2, 0, 1)
+ }
+
+ return x
+ }
+}
diff --git a/src/layers/convolutional/Cropping3D.js b/src/layers/convolutional/Cropping3D.js
new file mode 100644
index 0000000..8a1ce85
--- /dev/null
+++ b/src/layers/convolutional/Cropping3D.js
@@ -0,0 +1,60 @@
+import Layer from '../../Layer'
+import Tensor from '../../Tensor'
+import ops from 'ndarray-ops'
+
+/**
+ * Cropping3D layer class
+ */
+export default class Cropping3D extends Layer {
+ /**
+ * Creates a Cropping3D activation layer
+ * @param {cropping} attrs.cropping - tuple of tuple of int (length 3)
+ */
+ constructor (attrs = {}) {
+ super(attrs)
+ this.layerClass = 'Cropping3D'
+
+ const {
+ cropping = [[0,0], [0,0], [0,0]],
+ dimOrdering = 'tf'
+ } = attrs
+
+ this.cropping = cropping
+ this.dimOrdering = dimOrdering
+ }
+
+ /**
+ * Method for layer computational logic
+ * @param {Tensor} x
+ * @returns {Tensor} x
+ */
+ call (x) {
+ // convert to tf ordering
+ if (this.dimOrdering === 'th') {
+ x.tensor = x.tensor.transpose(1, 2, 3, 0)
+ }
+
+ const inputShape = x.tensor.shape
+ const outputShape = [
+ inputShape[0] - this.cropping[0][0] - this.cropping[0][1],
+ inputShape[1] - this.cropping[1][0] - this.cropping[1][1],
+ inputShape[2] - this.cropping[2][0] - this.cropping[2][1],
+ inputShape[3]
+ ]
+ let y = new Tensor([], outputShape)
+ ops.assign(
+ y.tensor,
+ x.tensor
+ .hi(inputShape[0] - this.cropping[0][1], inputShape[1] - this.cropping[1][1], inputShape[2] - this.cropping[2][1], inputShape[3])
+ .lo(this.cropping[0][0], this.cropping[1][0], this.cropping[2][0], 0)
+ )
+ x.tensor = y.tensor
+
+ // convert back to th ordering if necessary
+ if (this.dimOrdering === 'th') {
+ x.tensor = x.tensor.transpose(3, 0, 1, 2)
+ }
+
+ return x
+ }
+}
diff --git a/src/layers/convolutional/index.js b/src/layers/convolutional/index.js
index 187c2fa..a1bd2c1 100644
--- a/src/layers/convolutional/index.js
+++ b/src/layers/convolutional/index.js
@@ -10,6 +10,9 @@ import UpSampling3D from './UpSampling3D'
import ZeroPadding1D from './ZeroPadding1D'
import ZeroPadding2D from './ZeroPadding2D'
import ZeroPadding3D from './ZeroPadding3D'
+import Cropping1D from './Cropping1D'
+import Cropping2D from './Cropping2D'
+import Cropping3D from './Cropping3D'
export {
Convolution1D,
@@ -23,5 +26,8 @@ export {
UpSampling3D,
ZeroPadding1D,
ZeroPadding2D,
- ZeroPadding3D
+ ZeroPadding3D,
+ Cropping1D,
+ Cropping2D,
+ Cropping3D
}
diff --git a/test/convolutional/Cropping1D.js b/test/convolutional/Cropping1D.js
new file mode 100644
index 0000000..7614219
--- /dev/null
+++ b/test/convolutional/Cropping1D.js
@@ -0,0 +1,48 @@
+/* eslint-env browser, mocha */
+
+describe('convolutional layer: Cropping1D', function () {
+ const assert = chai.assert
+ const styles = testGlobals.styles
+ const logTime = testGlobals.logTime
+ const stringifyCondensed = testGlobals.stringifyCondensed
+ const approxEquals = KerasJS.testUtils.approxEquals
+ const layers = KerasJS.layers
+
+ before(function () {
+ console.log('\n%cconvolutional layer: Cropping1D', styles.h1)
+ })
+
+ it(`[convolutional.Cropping1D.0] cropping (1,1) on 6x4 input`, function () {
+ const key = `convolutional.Cropping1D.0`
+ console.log(`\n%c[${key}] cropping (1,1) on 6x4 input`, styles.h3)
+ let testLayer = new layers.Cropping1D({ cropping: [1,1] })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+
+ it(`[convolutional.Cropping1D.1] cropping (2,3) on 6x4 input`, function () {
+ const key = `convolutional.Cropping1D.1`
+ console.log(`\n%c[${key}] cropping (2,3) on 6x4 input`, styles.h3)
+ let testLayer = new layers.Cropping1D({ cropping: [2,3] })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+})
diff --git a/test/convolutional/Cropping2D.js b/test/convolutional/Cropping2D.js
new file mode 100644
index 0000000..f3b1ec3
--- /dev/null
+++ b/test/convolutional/Cropping2D.js
@@ -0,0 +1,82 @@
+/* eslint-env browser, mocha */
+
+describe('convolutional layer: Cropping2D', function () {
+ const assert = chai.assert
+ const styles = testGlobals.styles
+ const logTime = testGlobals.logTime
+ const stringifyCondensed = testGlobals.stringifyCondensed
+ const approxEquals = KerasJS.testUtils.approxEquals
+ const layers = KerasJS.layers
+
+ before(function () {
+ console.log('\n%cconvolutional layer: Cropping2D', styles.h1)
+ })
+
+ it(`[convolutional.Cropping2D.0] cropping (1,1),(1, 1) on 3x5x4 input, dim_ordering=tf`, function () {
+ const key = `convolutional.Cropping2D.0`
+ console.log(`\n%c[${key}] cropping (1,1),(1, 1) on 3x5x4 input, dimOrdering=tf`, styles.h3)
+ let testLayer = new layers.Cropping2D({ cropping: [[1, 1], [1, 1]], dimOrdering: 'tf' })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+
+ it(`[convolutional.Cropping2D.0] cropping (1,1),(1, 1) on 3x5x4 input, dim_ordering=th`, function () {
+ const key = `convolutional.Cropping2D.1`
+ console.log(`\n%c[${key}] cropping (1,1),(1, 1) on 3x5x4 input, dimOrdering=th`, styles.h3)
+ let testLayer = new layers.Cropping2D({ cropping: [[1, 1], [1, 1]], dimOrdering: 'th' })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+
+ it(`[convolutional.Cropping2D.2] cropping (4,2),(3,1) on 8x7x6 input, dim_ordering=tf`, function () {
+ const key = `convolutional.Cropping2D.2`
+ console.log(`\n%c[${key}] cropping (4,2),(3,1) on 8x7x6 input, dimOrdering=tf`, styles.h3)
+ let testLayer = new layers.Cropping2D({ cropping: [[4,2],[3,1]], dimOrdering: 'tf' })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+
+ it(`[convolutional.Cropping2D.2] cropping (4,2),(3,1) on 8x7x6 input, dim_ordering=th`, function () {
+ const key = `convolutional.Cropping2D.3`
+ console.log(`\n%c[${key}] cropping (4,2),(3,1) on 8x7x6 input, dimOrdering=th`, styles.h3)
+ let testLayer = new layers.Cropping2D({ cropping: [[4,2],[3,1]], dimOrdering: 'th' })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+})
diff --git a/test/convolutional/Cropping3D.js b/test/convolutional/Cropping3D.js
new file mode 100644
index 0000000..5527de7
--- /dev/null
+++ b/test/convolutional/Cropping3D.js
@@ -0,0 +1,82 @@
+/* eslint-env browser, mocha */
+
+describe('convolutional layer: Cropping3D', function () {
+ const assert = chai.assert
+ const styles = testGlobals.styles
+ const logTime = testGlobals.logTime
+ const stringifyCondensed = testGlobals.stringifyCondensed
+ const approxEquals = KerasJS.testUtils.approxEquals
+ const layers = KerasJS.layers
+
+ before(function () {
+ console.log('\n%cconvolutional layer: Cropping3D', styles.h1)
+ })
+
+ it(`[convolutional.Cropping3D.0] cropping ((1,1), (1,1), (1,1)) on 3x5x3x3 input, dim_ordering=tf`, function () {
+ const key = `convolutional.Cropping3D.0`
+ console.log(`\n%c[${key}] cropping ((1,1), (1,1), (1,1)) on 3x5x3x3 input, dim_ordering=tf`, styles.h3)
+ let testLayer = new layers.Cropping3D({ cropping: [[1, 1], [1, 1], [1,1]], dimOrdering: 'tf' })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+
+ it(`[convolutional.Cropping3D.0] cropping ((1,1), (1,1), (1,1)) on 3x5x3x3 input, dim_ordering=th`, function () {
+ const key = `convolutional.Cropping3D.1`
+ console.log(`\n%c[${key}] cropping ((1,1), (1,1), (1,1)) on 3x5x3x3 input, dim_ordering=th`, styles.h3)
+ let testLayer = new layers.Cropping3D({ cropping: [[1, 1], [1, 1], [1,1]], dimOrdering: 'th' })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+
+ it(`[convolutional.Cropping3D.2] cropping (3,2), (2,1), (2,3)) on 7x6x6x6 input, dim_ordering=tf`, function () {
+ const key = `convolutional.Cropping3D.2`
+ console.log(`\n%c[${key}] cropping (3,2), (2,1), (2,3)) on 7x6x6x6 input, dim_ordering=tf`, styles.h3)
+ let testLayer = new layers.Cropping3D({ cropping: [[3,2],[2,1],[2,3]], dimOrdering: 'tf' })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+
+ it(`[convolutional.Cropping3D.2] cropping (3,2), (2,1), (2,3)) on 7x6x6x6 input, dim_ordering=th`, function () {
+ const key = `convolutional.Cropping3D.3`
+ console.log(`\n%c[${key}] cropping (3,2), (2,1), (2,3)) on 7x6x6x6 input, dim_ordering=th`, styles.h3)
+ let testLayer = new layers.Cropping3D({ cropping: [[3,2],[2,1],[2,3]], dimOrdering: 'th' })
+ let t = new KerasJS.Tensor(TEST_DATA[key].input.data, TEST_DATA[key].input.shape)
+ console.log('%cin', styles.h4, stringifyCondensed(t.tensor))
+ const startTime = performance.now()
+ t = testLayer.call(t)
+ const endTime = performance.now()
+ console.log('%cout', styles.h4, stringifyCondensed(t.tensor))
+ logTime(startTime, endTime)
+ const dataExpected = new Float32Array(TEST_DATA[key].expected.data)
+ const shapeExpected = TEST_DATA[key].expected.shape
+ assert.deepEqual(t.tensor.shape, shapeExpected)
+ assert.isTrue(approxEquals(t.tensor, dataExpected))
+ })
+})
diff --git a/test/convolutional/data_Cropping1D.js b/test/convolutional/data_Cropping1D.js
new file mode 100644
index 0000000..8c3a8b8
--- /dev/null
+++ b/test/convolutional/data_Cropping1D.js
@@ -0,0 +1,30 @@
+// TEST DATA
+// Keyed by mocha test ID
+// Python code for generating test data can be found in the matching jupyter notebook in folder `notebooks/`.
+
+(function () {
+ var DATA = {
+ 'convolutional.Cropping1D.0': {
+ input: {
+ data: [-0.412987, -0.139246, 0.567466, -0.512174, -0.33603, 0.585584, 0.453472, 0.942013, -0.609538, -0.894302, 0.711927, -0.126057, 0.677549, 0.676991, 0.471487, 0.752844, 0.218213, 0.37408, 0.09404, -0.786108, -0.1961, -0.031679, -0.188902, 0.846634],
+ shape: [6,4]
+ },
+ expected: {
+ data: [-0.33603, 0.585584, 0.453472, 0.942013, -0.609538, -0.894302, 0.711927, -0.126057, 0.677549, 0.676991, 0.471487, 0.752844, 0.218213, 0.37408, 0.09404, -0.786108],
+ shape: [4, 4]
+ }
+ },
+ 'convolutional.Cropping1D.1': {
+ input: {
+ data: [0.229895, 0.156613, -0.66952, -0.996975, 0.45773, 0.684298, -0.999213, 0.276751, -0.484373, -0.506163, 0.353904, 0.513668, -0.981594, 0.78914, 0.603978, 0.204066, 0.532874, 0.866766, -0.544852, 0.876693, -0.523052, -0.716556, 0.875262, 0.544879],
+ shape: [6, 4]
+ },
+ expected: {
+ data: [-0.484373, -0.506163, 0.353904, 0.513668],
+ shape: [1, 4]
+ }
+ }
+ }
+
+ window.TEST_DATA = Object.assign({}, window.TEST_DATA, DATA)
+})()
diff --git a/test/convolutional/data_Cropping2D.js b/test/convolutional/data_Cropping2D.js
new file mode 100644
index 0000000..f53fc03
--- /dev/null
+++ b/test/convolutional/data_Cropping2D.js
@@ -0,0 +1,50 @@
+// TEST DATA
+// Keyed by mocha test ID
+// Python code for generating test data can be found in the matching jupyter notebook in folder `notebooks/`.
+
+(function () {
+ var DATA = {
+ 'convolutional.Cropping2D.0': {
+ input: {
+ data: [-0.570441, -0.454673, -0.285321, 0.237249, 0.282682, 0.428035, 0.160547, -0.332203, 0.546391, 0.272735, 0.010827, -0.763164, -0.442696, 0.381948, -0.676994, 0.753553, -0.031788, 0.915329, -0.738844, 0.269075, 0.434091, 0.991585, -0.944288, 0.258834, 0.162138, 0.565201, -0.492094, 0.170854, -0.139788, -0.710674, 0.406968, 0.705926, -0.094137, -0.793497, -0.040684, 0.522292, 0.490496, -0.651771, 0.293113, -0.580922, -0.396436, 0.864522, -0.411659, 0.317379, 0.771844, 0.507235, 0.067782, 0.922641, -0.944205, 0.383713, -0.380187, -0.875176, 0.799314, -0.681818, -0.761323, 0.768315, -0.298568, -0.611688, -0.768656, 0.525693],
+ shape: [3, 5, 4]
+ },
+ expected: {
+ data: [0.162138, 0.565201, -0.492094, 0.170854, -0.139788, -0.710674, 0.406968, 0.705926, -0.094137, -0.793497, -0.040684, 0.522292],
+ shape: [1, 3, 4]
+ }
+ },
+ 'convolutional.Cropping2D.1': {
+ input: {
+ data: [-0.570441, -0.454673, -0.285321, 0.237249, 0.282682, 0.428035, 0.160547, -0.332203, 0.546391, 0.272735, 0.010827, -0.763164, -0.442696, 0.381948, -0.676994, 0.753553, -0.031788, 0.915329, -0.738844, 0.269075, 0.434091, 0.991585, -0.944288, 0.258834, 0.162138, 0.565201, -0.492094, 0.170854, -0.139788, -0.710674, 0.406968, 0.705926, -0.094137, -0.793497, -0.040684, 0.522292, 0.490496, -0.651771, 0.293113, -0.580922, -0.396436, 0.864522, -0.411659, 0.317379, 0.771844, 0.507235, 0.067782, 0.922641, -0.944205, 0.383713, -0.380187, -0.875176, 0.799314, -0.681818, -0.761323, 0.768315, -0.298568, -0.611688, -0.768656, 0.525693],
+ shape: [3, 5, 4]
+ },
+ expected: {
+ data: [0.428035, 0.160547, 0.272735, 0.010827, 0.381948, -0.676994, 0.565201, -0.492094, -0.710674, 0.406968, -0.793497, -0.040684, 0.507235, 0.067782, 0.383713, -0.380187, -0.681818, -0.761323],
+ shape: [3, 3, 2]
+ }
+ },
+ 'convolutional.Cropping2D.2': {
+ input: {
+ data:[-0.989173, -0.133618, -0.505338, 0.023259, 0.503982, -0.303769, -0.436321, 0.793911, 0.416102, 0.806405, -0.098342, -0.738022, -0.982676, 0.805073, 0.741244, -0.941634, -0.253526, -0.136544, -0.295772, 0.207565, -0.517246, -0.686963, -0.176235, -0.354111, -0.862411, -0.969822, 0.200074, 0.290718, -0.038623, 0.294839, 0.247968, 0.557946, -0.455596, 0.6624, 0.879529, -0.466772, 0.40423, 0.213794, 0.645662, -0.044634, -0.552595, 0.771242, -0.131944, -0.172725, 0.700856, -0.001994, 0.606737, -0.593306, 0.898062, -0.203771, 0.645788, 0.596358, -0.571654, -0.636819, -0.367376, -0.892607, -0.123297, 0.748404, -0.783012, 0.061963, -0.908546, -0.988517, 0.97308, 0.483845, 0.967956, 0.95863, 0.633963, -0.109138, -0.615821, -0.479821, 0.42827, 0.761351, 0.108265, -0.835679, -0.200177, 0.556308, -0.346135, -0.591775, 0.888818, 0.088756, 0.887542, 0.231398, -0.062874, 0.379803, 0.248259, -0.004909, -0.694836, 0.246241, 0.576698, 0.877474, 0.353439, 0.528707, 0.585634, -0.985339, 0.438776, -0.314863, 0.784171, 0.12525, 0.889265, -0.644213, 0.052514, 0.733269, 0.099278, -0.141949, 0.498542, 0.735955, 0.760313, -0.660278, -0.604273, 0.199522, 0.346309, -0.488666, 0.706332, 0.995574, 0.234642, 0.042779, 0.583139, 0.159919, 0.104808, 0.232585, 0.625624, 0.748204, -0.878399, 0.514601, -0.392989, -0.835864, 0.247256, -0.889704, -0.776558, 0.069902, -0.982291, 0.139565, 0.559765, 0.364254, -0.167329, -0.027032, -0.396669, 0.887928, 0.24142, -0.950083, -0.354758, 0.815999, -0.533224, 0.001955, -0.997966, -0.716888, 0.861882, -0.883, 0.797625, 0.602008, -0.633245, -0.710132, 0.608369, -0.784398, 0.576564, 0.633279, 0.542795, 0.90345, 0.457414, 0.242734, 0.310622, -0.82517, 0.262998, -0.571046, 0.936527, 0.878469, -0.347791, -0.859749, -0.952931, -0.129702, 0.685477, -0.796418, 0.377681, 0.858414, -0.835134, 0.014816, 0.103085, 0.850919, -0.005764, 0.715943, 0.003942, 0.746505, -0.422674, 0.819656, 0.037147, 0.078259, 0.609219, 0.240121, -0.457013, -0.947625, -0.598543, 0.754378, 0.694688, 0.001741, -0.731877, -0.442437, 0.116966, 0.360755, 0.396709, 0.018889, -0.243222, 0.03233, 0.154516, 0.04915, 0.942633, -0.225662, 0.778155, 0.927135, -0.298936, -0.73013, -0.978144, -0.838932, 0.085808, -0.636771, -0.209125, 0.739682, 0.447976, -0.737185, 0.645007, -0.038338, -0.031764, -0.667117, -0.075763, 0.701876, 0.505738, 0.997181, -0.554428, -0.862689, 0.966555, 0.401094, -0.489316, 0.197598, 0.440944, 0.437652, -0.078096, 0.271921, 0.702964, -0.154695, 0.964746, 0.089738, -0.530063, -0.374368, -0.501949, -0.435823, -0.059041, 0.059762, 0.18368, -0.879219, -0.853283, 0.463376, 0.790678, -0.906068, -0.772338, 0.117419, 0.409168, 0.219139, -0.017059, 0.552391, 0.835856, -0.710045, 0.404615, -0.182959, -0.331881, -0.395508, -0.730692, 0.252354, 0.915251, -0.79357, 0.70079, -0.011832, -0.18324, 0.070365, 0.769189, 0.383026, -0.868293, 0.800455, 0.727587, -0.62417, -0.300598, -0.63724, -0.08886, 0.176103, 0.086305, -0.782202, -0.719459, -0.153585, -0.037527, 0.923902, 0.043134, -0.500307, -0.862448, -0.591515, 0.803712, 0.066251, -0.016947, 0.412293, -0.004009, 0.370996, -0.556311, -0.286518, -0.454324, 0.069928, -0.002182, -0.425322, 0.99516, 0.537532, 0.054711, 0.22533, -0.238724, 0.495853, 0.901436, 0.405811, -0.430268, -0.542533, -0.663813, -0.007121, 0.462074, -0.349408, 0.257701, 0.493632, -0.674434, -0.235252, 0.039342, 0.166896, 0.724501, 0.41962, -0.566634, 0.811497, 0.614648, -0.109631, -0.830493, -0.022923, -0.890479, 0.487839, 0.967617, 0.629215],
+ shape: [8, 7, 6]
+ },
+ expected: {
+ data: [0.609218, 0.240121, -0.457013, -0.947625, -0.598543, 0.754378, 0.694688, 0.001741, -0.731877, -0.442437, 0.116966, 0.360755, 0.396709, 0.018889, -0.243222, 0.03233, 0.154516, 0.04915, 0.966555, 0.401094, -0.489316, 0.197598, 0.440944, 0.437652, -0.078096, 0.271921, 0.702964, -0.154695, 0.964746, 0.089738, -0.530063, -0.374368, -0.501949, -0.435823, -0.059041, 0.059762],
+ shape: [2, 3, 6]
+ }
+ },
+ 'convolutional.Cropping2D.3': {
+ input: {
+ data: [-0.989173, -0.133618, -0.505338, 0.023259, 0.503982, -0.303769, -0.436321, 0.793911, 0.416102, 0.806405, -0.098342, -0.738022, -0.982676, 0.805073, 0.741244, -0.941634, -0.253526, -0.136544, -0.295772, 0.207565, -0.517246, -0.686963, -0.176235, -0.354111, -0.862411, -0.969822, 0.200074, 0.290718, -0.038623, 0.294839, 0.247968, 0.557946, -0.455596, 0.6624, 0.879529, -0.466772, 0.40423, 0.213794, 0.645662, -0.044634, -0.552595, 0.771242, -0.131944, -0.172725, 0.700856, -0.001994, 0.606737, -0.593306, 0.898062, -0.203771, 0.645788, 0.596358, -0.571654, -0.636819, -0.367376, -0.892607, -0.123297, 0.748404, -0.783012, 0.061963, -0.908546, -0.988517, 0.97308, 0.483845, 0.967956, 0.95863, 0.633963, -0.109138, -0.615821, -0.479821, 0.42827, 0.761351, 0.108265, -0.835679, -0.200177, 0.556308, -0.346135, -0.591775, 0.888818, 0.088756, 0.887542, 0.231398, -0.062874, 0.379803, 0.248259, -0.004909, -0.694836, 0.246241, 0.576698, 0.877474, 0.353439, 0.528707, 0.585634, -0.985339, 0.438776, -0.314863, 0.784171, 0.12525, 0.889265, -0.644213, 0.052514, 0.733269, 0.099278, -0.141949, 0.498542, 0.735955, 0.760313, -0.660278, -0.604273, 0.199522, 0.346309, -0.488666, 0.706332, 0.995574, 0.234642, 0.042779, 0.583139, 0.159919, 0.104808, 0.232585, 0.625624, 0.748204, -0.878399, 0.514601, -0.392989, -0.835864, 0.247256, -0.889704, -0.776558, 0.069902, -0.982291, 0.139565, 0.559765, 0.364254, -0.167329, -0.027032, -0.396669, 0.887928, 0.24142, -0.950083, -0.354758, 0.815999, -0.533224, 0.001955, -0.997966, -0.716888, 0.861882, -0.883, 0.797625, 0.602008, -0.633245, -0.710132, 0.608369, -0.784398, 0.576564, 0.633279, 0.542795, 0.90345, 0.457414, 0.242734, 0.310622, -0.82517, 0.262998, -0.571046, 0.936527, 0.878469, -0.347791, -0.859749, -0.952931, -0.129702, 0.685477, -0.796418, 0.377681, 0.858414, -0.835134, 0.014816, 0.103085, 0.850919, -0.005764, 0.715943, 0.003942, 0.746505, -0.422674, 0.819656, 0.037147, 0.078259, 0.609219, 0.240121, -0.457013, -0.947625, -0.598543, 0.754378, 0.694688, 0.001741, -0.731877, -0.442437, 0.116966, 0.360755, 0.396709, 0.018889, -0.243222, 0.03233, 0.154516, 0.04915, 0.942633, -0.225662, 0.778155, 0.927135, -0.298936, -0.73013, -0.978144, -0.838932, 0.085808, -0.636771, -0.209125, 0.739682, 0.447976, -0.737185, 0.645007, -0.038338, -0.031764, -0.667117, -0.075763, 0.701876, 0.505738, 0.997181, -0.554428, -0.862689, 0.966555, 0.401094, -0.489316, 0.197598, 0.440944, 0.437652, -0.078096, 0.271921, 0.702964, -0.154695, 0.964746, 0.089738, -0.530063, -0.374368, -0.501949, -0.435823, -0.059041, 0.059762, 0.18368, -0.879219, -0.853283, 0.463376, 0.790678, -0.906068, -0.772338, 0.117419, 0.409168, 0.219139, -0.017059, 0.552391, 0.835856, -0.710045, 0.404615, -0.182959, -0.331881, -0.395508, -0.730692, 0.252354, 0.915251, -0.79357, 0.70079, -0.011832, -0.18324, 0.070365, 0.769189, 0.383026, -0.868293, 0.800455, 0.727587, -0.62417, -0.300598, -0.63724, -0.08886, 0.176103, 0.086305, -0.782202, -0.719459, -0.153585, -0.037527, 0.923902, 0.043134, -0.500307, -0.862448, -0.591515, 0.803712, 0.066251, -0.016947, 0.412293, -0.004009, 0.370996, -0.556311, -0.286518, -0.454324, 0.069928, -0.002182, -0.425322, 0.99516, 0.537532, 0.054711, 0.22533, -0.238724, 0.495853, 0.901436, 0.405811, -0.430268, -0.542533, -0.663813, -0.007121, 0.462074, -0.349408, 0.257701, 0.493632, -0.674434, -0.235252, 0.039342, 0.166896, 0.724501, 0.41962, -0.566634, 0.811497, 0.614648, -0.109631, -0.830493, -0.022923, -0.890479, 0.487839, 0.967617, 0.629215],
+ shape: [8, 7, 6]
+ },
+ expected: {
+ data: [0.290718, -0.038623, -0.479821, 0.42827, -0.488666, 0.706332, -0.784398, 0.576564, -0.442437, 0.116966, -0.154695, 0.964746, -0.63724, -0.08886, -0.235252, 0.039342],
+ shape: [8, 1, 2]
+ }
+ }
+ }
+
+ window.TEST_DATA = Object.assign({}, window.TEST_DATA, DATA)
+})()
diff --git a/test/convolutional/data_Cropping3D.js b/test/convolutional/data_Cropping3D.js
new file mode 100644
index 0000000..04bf6b3
--- /dev/null
+++ b/test/convolutional/data_Cropping3D.js
@@ -0,0 +1,50 @@
+// TEST DATA
+// Keyed by mocha test ID
+// Python code for generating test data can be found in the matching jupyter notebook in folder `notebooks/`.
+
+(function () {
+ var DATA = {
+ 'convolutional.Cropping3D.0': {
+ input: {
+ data: [-0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.617251, 0.334305, -0.351137, -0.642574, 0.108974, -0.993964, 0.051085, -0.372012, 0.843766, 0.088025, -0.598662, 0.789035, -0.971233, -0.917609, 0.10035, -0.993908, 0.001303, 0.151006, -0.222302, -0.462642, 0.318882, 0.910461, -0.951606, -0.628088, 0.858834, 0.18648, 0.005839, -0.976863, -0.602595, -0.907466, 0.537085, 0.254335, -0.624879, -0.26462, -0.597274, 0.717515, 0.933281, -0.928165, -0.664793, 0.350419, 0.604354, 0.134613, -0.170544, 0.287505, -0.342583, -0.908204, -0.055996, 0.686364, -0.877763, 0.666511, -0.333493, -0.283194, 0.764997, 0.702478, -0.495511, 0.451364, 0.945924, -0.238126, 0.146568, -0.281422, -0.379007, 0.914172, 0.337272, 0.175728, -0.945958, -0.727577, -0.133378, -0.069779, -0.952209, 0.237581, -0.244335, 0.838199, -0.187442, 0.255861, 0.28158, -0.60797, 0.992258, 0.16382, 0.240562, 0.353587, 0.300174, 0.216722, -0.422345, -0.239941, 0.354771, 0.567014, -0.085289, 0.751301, -0.255041, -0.656808, -0.220736, -0.275667, 0.568007, 0.251274, 0.888831, 0.976139, 0.040987, 0.474905, 0.181267, 0.707542, -0.570195, 0.897656, -0.91601, -0.419443, -0.346422, -0.770603, 0.883902, -0.490007, 0.470248, -0.217687, 0.365399],
+ shape: [3, 5, 3, 3]
+ },
+ expected: {
+ data: [-0.26462, -0.597274, 0.717515, -0.170544, 0.287505, -0.342583, -0.283194, 0.764997, 0.702478],
+ shape: [1, 3, 1, 3]
+ }
+ },
+ 'convolutional.Cropping3D.1': {
+ input: {
+ data: [-0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.617251, 0.334305, -0.351137, -0.642574, 0.108974, -0.993964, 0.051085, -0.372012, 0.843766, 0.088025, -0.598662, 0.789035, -0.971233, -0.917609, 0.10035, -0.993908, 0.001303, 0.151006, -0.222302, -0.462642, 0.318882, 0.910461, -0.951606, -0.628088, 0.858834, 0.18648, 0.005839, -0.976863, -0.602595, -0.907466, 0.537085, 0.254335, -0.624879, -0.26462, -0.597274, 0.717515, 0.933281, -0.928165, -0.664793, 0.350419, 0.604354, 0.134613, -0.170544, 0.287505, -0.342583, -0.908204, -0.055996, 0.686364, -0.877763, 0.666511, -0.333493, -0.283194, 0.764997, 0.702478, -0.495511, 0.451364, 0.945924, -0.238126, 0.146568, -0.281422, -0.379007, 0.914172, 0.337272, 0.175728, -0.945958, -0.727577, -0.133378, -0.069779, -0.952209, 0.237581, -0.244335, 0.838199, -0.187442, 0.255861, 0.28158, -0.60797, 0.992258, 0.16382, 0.240562, 0.353587, 0.300174, 0.216722, -0.422345, -0.239941, 0.354771, 0.567014, -0.085289, 0.751301, -0.255041, -0.656808, -0.220736, -0.275667, 0.568007, 0.251274, 0.888831, 0.976139, 0.040987, 0.474905, 0.181267, 0.707542, -0.570195, 0.897656, -0.91601, -0.419443, -0.346422, -0.770603, 0.883902, -0.490007, 0.470248, -0.217687, 0.365399],
+ shape: [3, 5, 3, 3]
+ },
+ expected: {
+ data: [-0.700858, -0.90685, -0.372012, -0.597274, 0.287505, 0.764997, 0.353587, -0.255041, 0.474905],
+ shape: [3, 3, 1, 1]
+ }
+ },
+ 'convolutional.Cropping3D.2': {
+ input: {
+ data: [-0.215694, 0.441215, 0.116911, 0.53299, 0.883562, -0.535525, -0.869764, -0.596287, 0.576428, -0.689083, -0.132924, -0.129935, -0.17672, -0.29097, 0.590914, 0.992098, 0.908965, -0.170202, 0.640203, 0.178644, 0.866749, -0.545566, -0.827072, 0.420342, -0.076191, 0.207686, -0.908472, -0.795307, -0.948319, 0.683682, -0.563278, -0.82135, 0.391356, 0.873557, 0.101774, 0.552487, -0.805471, -0.158387, 0.737777, 0.407663, 0.024323, 0.931444, -0.813418, -0.054911, -0.8488, -0.528392, 0.31073, -0.518975, -0.334317, 0.984459, 0.876118, 0.939272, -0.286813, -0.499695, 0.741409, 0.979405, 0.384731, -0.861441, 0.956879, 0.371096, 0.395767, -0.182768, -0.04864, 0.943523, 0.252702, -0.922957, 0.084044, -0.151514, -0.104476, -0.519114, 0.170185, -0.304221, 0.648458, 0.975786, -0.026504, 0.806763, -0.551306, 0.363744, -0.253539, 0.520681, -0.555914, 0.164078, 0.069617, 0.61564, -0.814065, 0.834879, 0.448904, 0.572477, -0.634663, -0.962277, -0.511182, 0.28331, 0.456662, 0.097291, -0.612782, 0.780788, 0.815368, -0.045092, -0.154594, -0.749131, -0.13425, 0.067759, 0.965334, -0.402963, -0.305027, 0.900762, -0.68091, -0.760497, -0.702999, -0.479565, 0.705878, 0.739556, 0.743407, -0.08787, 0.194838, 0.444586, -0.237847, 0.714397, 0.003476, 0.176333, 0.318089, -0.210574, 0.665183, -0.74621, -0.439604, -0.032897, -0.67171, 0.757381, -0.117032, -0.832812, 0.562207, -0.824057, 0.147708, 0.608499, 0.377938, -0.930702, 0.04294, -0.039472, -0.517352, -0.64207, 0.361295, -0.544495, 0.825223, 0.473357, -0.733994, -0.368548, 0.586403, -0.465342, 0.72613, -0.187859, 0.054425, 0.239031, 0.854588, 0.829812, 0.848903, 0.139064, 0.008025, -0.546984, 0.395519, -0.866557, 0.801336, -0.732569, -0.185929, 0.152884, -0.953483, 0.930523, -0.54922, -0.093218, 0.325075, -0.719152, -0.633034, -0.753904, 0.344891, -0.963772, -0.446026, 0.286814, 0.756519, 0.372178, 0.071732, -0.188247, 0.693894, -0.43033, -0.903031, -0.492189, 0.899836, -0.552368, -0.553622, -0.679484, 0.016195, 0.891604, 0.779606, 0.149406, 0.752016, -0.695177, -0.930224, -0.664835, -0.79635, 0.423615, -0.254402, 0.159415, -0.15244, 0.820635, 0.770241, 0.815006, -0.485857, 0.294987, 0.964034, 0.134613, 0.673378, -0.376272, -0.808101, 0.412723, 0.573529, 0.005777, -0.053066, -0.700318, 0.235987, -0.068263, 0.247649, -0.404731, 0.203814, -0.329107, -0.468369, 0.802557, 0.66231, -0.149117, -0.138193, -0.101905, -0.035625, -0.443804, -0.78221, -0.073352, 0.550544, 0.364402, 0.969535, -0.108104, -0.87979, -0.49984, 0.412514, -0.689554, -0.126264, -0.471823, -0.446719, -0.720356, 0.457369, 0.985619, 0.607835, 0.48972, -0.515463, -0.124945, -0.114273, 0.005033, 0.791923, 0.351923, -0.290373, -0.951029, 0.913971, -0.539169, -0.028312, -0.036768, -0.850635, -0.167548, -0.168993, -0.923405, 0.853735, -0.154032, 0.30117, -0.244491, 0.191919, -0.825866, 0.634476, -0.098177, 0.365853, -0.976385, -0.992225, -0.707116, 0.487679, 0.0492, -0.463333, -0.173074, 0.83129, -0.141277, -0.806725, -0.935533, 0.843659, 0.476078, -0.071665, 0.159787, -0.917204, -0.54939, 0.593851, -0.599885, 0.524063, 0.326937, -0.238377, 0.097153, 0.343496, -0.58839, 0.830905, 0.442858, 0.462174, 0.705181, 0.048056, -0.938781, 0.653592, -0.730406, -0.929912, 0.897714, -0.735706, -0.410101, -0.955015, -0.001601, 0.085032, -0.055787, -0.944858, -0.793914, 0.000563, -0.16397, 0.33181, -0.289269, 0.10943, 0.944269, -0.193446, 0.48286, -0.195952, -0.511226, -0.448196, 0.695966, -0.12916, -0.713753, -0.64093, 0.716985, -0.098099, 0.123401, -0.056109, 0.010111, 0.352437, -0.509194, 0.750921, 0.253841, -0.708165, 0.821124, 0.006613, 0.098428, -0.78475, -0.60798, -0.947196, 0.282283, -0.262235, 0.53522, -0.864729, -0.119298, 0.936872, 0.180087, 0.977898, -0.025644, -0.558908, 0.715291, 0.000521, -0.764904, 0.319351, 0.980566, -0.786352, -0.532971, 0.22349, -0.716549, -0.310122, -0.487408, -0.440706, 0.977597, 0.983465, 0.234706, -0.604104, -0.965578, -0.580777, -0.791097, -0.091303, 0.973252, -0.612431, -0.843771, 0.759226, -0.496212, -0.798771, 0.088759, -0.344253, 0.431093, -0.794068, -0.225465, 0.339765, 0.130517, -0.512642, -0.109772, -0.90458, 0.404718, 0.704574, 0.758276, 0.659395, 0.443485, 0.506577, -0.883215, 0.828717, -0.532839, -0.743989, -0.561542, 0.237909, -0.11387, 0.580675, 0.939269, 0.922755, -0.262718, 0.345844, 0.690802, -0.151282, 0.655477, 0.035601, 0.611308, -0.530814, -0.8206, -0.524242, -0.493136, -0.074615, -0.412433, -0.082067, -0.188891, 0.788821, -0.264136, -0.188681, -0.001166, -0.237385, 0.716098, -0.055445, 0.903261, -0.690342, 0.345747, -0.8422, 0.681083, -0.880773, -0.47829, -0.087262, 0.286764, -0.73948, 0.938692, -0.734384, 0.836267, 0.428397, -0.284466, 0.087184, 0.565192, -0.92756, -0.617862, -0.902012, -0.97077, -0.3262, -0.117703, 0.324541, 0.790994, 0.960735, 0.858284, 0.35247, 0.199395, -0.886025, -0.403741, 0.286867, -0.745825, -0.575954, 0.393387, 0.161558, 0.933436, -0.04139, 0.712661, -0.621411, -0.704434, 0.374135, -0.71425, 0.502797, 0.034642, 0.633788, -0.449388, -0.593975, 0.805345, -0.399393, 0.518122, -0.382023, -0.698987, 0.925711, -0.808321, 0.670118, -0.306688, 0.038679, -0.880873, -0.105844, -0.335898, 0.321574, 0.976045, 0.664659, 0.341049, -0.813552, -0.181204, -0.457684, -0.944205, 0.130818, 0.91465, 0.375795, -0.83426, -0.884669, 0.884202, 0.524805, 0.866177, 0.605792, -0.143796, -0.468536, -0.848138, -0.471953, -0.958303, 0.221358, -0.120887, -0.368682, -0.346116, -0.182678, -0.569586, 0.328268, 0.744066, -0.089028, -0.413939, 0.966069, 0.806133, 0.811337, -0.216864, 0.519711, 0.532548, 0.782122, -0.594866, -0.414185, -0.96614, 0.504274, 0.770258, -0.81789, -0.441714, -0.43652, 0.582823, 0.838065, -0.213008, -0.643435, 0.230493, -0.679991, -0.179979, -0.931999, -0.154311, 0.96013, -0.202379, 0.473898, 0.401901, 0.485608, 0.835172, 0.767556, -0.318512, 0.869208, 0.091651, -0.450239, 0.921468, 0.980922, 0.874128, -0.457308, -0.78107, -0.604558, -0.107902, -0.868826, 0.761486, 0.985782, 0.18808, 0.034727, -0.51135, 0.007318, -0.412556, -0.575671, 0.262399, -0.431255, 0.236753, 0.234476, -0.009731, -0.469543, 0.335344, -0.006414, 0.127297, -0.300389, 0.608195, -0.556598, 0.611592, 0.828308, 0.66101, 0.139477, -0.559037, -0.34807, 0.920787, 0.967347, 0.615015, -0.182736, 0.942934, -0.622099, 0.944364, -0.700525, 0.283057, 0.214233, -0.352612, -0.391157, -0.6866, -0.949089, -0.830036, 0.028655, 0.160321, 0.962427, 0.771235, 0.701332, -0.073448, -0.880306, -0.67372, 0.579104, 0.832739, -0.451863, 0.830591, -0.393846, -0.87822, 0.432681, -0.222904, -0.855099, -0.703505, -0.723594, -0.401981, -0.304913, -0.60108, -0.207273, -0.259013, 0.065798, 0.244318, 0.518287, -0.047123, 0.769841, -0.833204, -0.936774, 0.74598, -0.557437, -0.221576, -0.913191, 0.108353, 0.115733, 0.013277, 0.439679, 0.422073, 0.303912, -0.021176, -0.91273, -0.909738, 0.559815, 0.621811, 0.907303, 0.34733, -0.143574, -0.215208, -0.919455, 0.860239, 0.041072, -0.011693, -0.787824, 0.551498, 0.966032, -0.763429, 0.548998, 0.155827, -0.539245, -0.508795, -0.076923, -0.430267, -0.026247, 0.110006, 0.050526, 0.312362, -0.29318, -0.913974, -0.018903, 0.348191, 0.43283, -0.339458, 0.67296, -0.503704, -0.126925, 0.126921, 0.681079, -0.18157, -0.846449, 0.561337, -0.162773, 0.578579, 0.845398, -0.535639, 0.928576, -0.333678, 0.755441, 0.76015, 0.329895, 0.144662, -0.208612, -0.298499, 0.978054, 0.087719, 0.56864, 0.791894, 0.633447, -0.829405, 0.696793, 0.844902, 0.639941, 0.855367, -0.563831, 0.11538, -0.838183, -0.340807, -0.765973, -0.201738, 0.901256, 0.461485, -0.922959, -0.543252, 0.247037, -0.603098, 0.143447, -0.298636, 0.255228, 0.555237, -0.142739, 0.094639, -0.003793, 0.585846, 0.795219, -0.16835, -0.51469, 0.478591, -0.749477, 0.155347, 0.706903, 0.047964, 0.239316, 0.790049, 0.707638, -0.367523, -0.852255, 0.309914, 0.848387, -0.859448, -0.273302, -0.337586, 0.048332, 0.927994, 0.564126, 0.254753, -0.573478, -0.346197, -0.715717, -0.051958, -0.494504, 0.599351, 0.984027, 0.23743, 0.854292, 0.20021, 0.100571, -0.407464, 0.395228, 0.987905, 0.195573, 0.58147, 0.06667, 0.854165, 0.416721, 0.034649, 0.241931, -0.819904, -0.738848, 0.008158, -0.725937, 0.478754, 0.883892, -0.11895, 0.422474, 0.755278, -0.107855, 0.893582, -0.656121, 0.169792, 0.026624, -0.854244, 0.043245, 0.013092, 0.906277, 0.050616, 0.137537, 0.123879, -0.829904, -0.8344, -0.500271, 0.187797, 0.480912, 0.689756, 0.648658, 0.112738, 0.480717, 0.050545, -0.517454, 0.646335, -0.520894, 0.298304, 0.00373, 0.176349, -0.112375, -0.844539, -0.292901, 0.027739, 0.113266, 0.867302, 0.893293, 0.951617, 0.858295, 0.403715, -0.694067, 0.018322, 0.604787, 0.904331, -0.877118, -0.381556, 0.302968, -0.884946, 0.634482, 0.2684, 0.07795, -0.552023, -0.497385, -0.001392, 0.613874, 0.312707, -0.516964, 0.07461, -0.532681, 0.097518, 0.018129, -0.312512, -0.860073, 0.318977, -0.744195, -0.150664, -0.53404, -0.428665, -0.174314, 0.247514, -0.595893, 0.748659, -0.37269, 0.780516, 0.655175, -0.511935, -0.747456, 0.111773, -0.309556, 0.636038, -0.256566, -0.724825, -0.316549, -0.868989, -0.706117, -0.824815, -0.618301, 0.856392, -0.996149, 0.63829, 0.880169, 0.893699, -0.893984, -0.046652, 0.315952, -0.44143, -0.864354, 0.892476, -0.211045, 0.059187, 0.57039, -0.997778, 0.191066, -0.830022, 0.650504, -0.530842, 0.058659, 0.952869, -0.157372, 0.92573, 0.928522, -0.45409, -0.778338, -0.363509, -0.763773, 0.679892, 0.241852, 0.351275, -0.258137, 0.395351, -0.381122, 0.709346, 0.375105, 0.28349, -0.151699, -0.887474, -0.980568, -0.84615, 0.90203, 0.770327, 0.159608, -0.959841, 0.784576, 0.545309, 0.493765, -0.27253, 0.655846, 0.553353, 0.152227, 0.438126, 0.987307, 0.403776, -0.232088, -0.605441, -0.090541, -0.189261, -0.999625, 0.538246, 0.532891, -0.374952, -0.508505, 0.346032, -0.344552, -0.550043, -0.935551, -0.99107, -0.301938, -0.168825, 0.35326, -0.599303, -0.654331, -0.261841, -0.571388, 0.698991, -0.078255, -0.195565, 0.691759, -0.628298, 0.697236, 0.670352, 0.110078, -0.137484, -0.965838, 0.499479, -0.931003, 0.565995, -0.289345, 0.171825, 0.893263, -0.698565, 0.106203, 0.78723, -0.507623, 0.23409, -0.072888, 0.972045, -0.156797, -0.18569, -0.816269, 0.086552, -0.862185, 0.977191, -0.818147, -0.917344, -0.578661, 0.216002, 0.390336, 0.227703, 0.962969, 0.885609, -0.2223, 0.669628, 0.042634, -0.939601, -0.949383, -0.383965, -0.42231, -0.374712, 0.387369, 0.646834, 0.872373, -0.217432, -0.860018, -0.730193, -0.842808, -0.088775, -0.45984, -0.641785, 0.361352, 0.617324, 0.281634, -0.267519, -0.104152, 0.065566, 0.638451, -0.99023, 0.122453, -0.581285, -0.84508, -0.213483, -0.018054, -0.2835, 0.951819, 0.731384, -0.241599, -0.941958, -0.47496, -0.704789, -0.267755, -0.299397, 0.475516, 0.224848, -0.613151, 0.853631, -0.285596, -0.984425, -0.004342, -0.558075, -0.498553, 0.272694, 0.068413, 0.598389, -0.558155, -0.463243, 0.118942, 0.392428, 0.585269, 0.559008, 0.509983, -0.719725, 0.899859, -0.054641, 0.56467, -0.088496, -0.246774, -0.909083, -0.635166, -0.180455, -0.566009, -0.304824, -0.337654, -0.28894, -0.930163, -0.180485, -0.515424, 0.710147, -0.606524, 0.985967, 0.888985, 0.645856, 0.745228, 0.442467, -0.309917, 0.726975, 0.019567, -0.140183, 0.614124, -0.856526, -0.568601, -0.90666, -0.746201, 0.89231, 0.328027, 0.670873, 0.772824, -0.249407, -0.225128, -0.309643, 0.055451, 0.397084, -0.015763, -0.104947, 0.946976, 0.373816, -0.485013, 0.004047, -0.892327, 0.812327, 0.013913, 0.817028, -0.083667, 0.727218, -0.856644, 0.181954, -0.947651, 0.517506, 0.385722, -0.222445, -0.129355, -0.155133, -0.186532, 0.134046, -0.181235, 0.701509, 0.10727, -0.223625, 0.990662, -0.071366, 0.751143, 0.855357, 0.084802, -0.832278, -0.053375, -0.19636, -0.903927, 0.513069, 0.618, -0.530257, 0.910113, -0.970662, 0.740255, -0.542166, 0.70816, 0.340971, 0.015036, -0.561873, -0.576902, 0.959876, -0.552993, 0.25889, -0.901, 0.269618, 0.946302, 0.943612, 0.326183, -0.988706, 0.354102, 0.675289, -0.567086, -0.11179, 0.792741, -0.225879, 0.084516, -0.663273, -0.006569, -0.602323, -0.837099, 0.090505, 0.058281, 0.048858, -0.123648, 0.270346, -0.663069, 0.261073, 0.202716, -0.108538, 0.08633, -0.588139, 0.245405, 0.370942, -0.920384, -0.283831, 0.181426, 0.215151, 0.286008, 0.068399, 0.495306, 0.582592, 0.961226, 0.388063, 0.164688, 0.940278, 0.246888, -0.365183, -0.985746, 0.680361, -0.70754, -0.638368, -0.194461, 0.012646, -0.833634, -0.946438, -0.317705, -0.936933, -0.114303, -0.200694, 0.869011, 0.605997, 0.160927, -0.226291, -0.443921, 0.170021, -0.678198, -0.008692, -0.866096, 0.473826, 0.008789, -0.907462, 0.227272, -0.774721, 0.275255, -0.17879, 0.297924, 0.190216, 0.796589, 0.564772, 0.676277, 0.347743, 0.993239, -0.800231, -0.825401, 0.604841, -0.078256, -0.981104, -0.590065, -0.690202, -0.140628, -0.281607, 0.13361, 0.487755, 0.703334, -0.048199, -0.729918, 0.638745, -0.930051, 0.792881, 0.560942, 0.984295, -0.026256, -0.807647, 0.037724, -0.883297, 0.527074, -0.058281, -0.343332, 0.832498, -0.823443, -0.868069, -0.665845, -0.68803, -0.204482, -0.56854, 0.589662, -0.68208, -0.711295, -0.324815, -0.363985, -0.141501, 0.180616, 0.098551, 0.356221, 0.76361, -0.495118, -0.619777, 0.267608, 0.089808, 0.008487, 0.674874, -0.490058, 0.251746, 0.422547, 0.257684, 0.125063, -0.211933, -0.5837, 0.899513, -0.843382, 0.809206, 0.015723, 0.099545, 0.847903, 0.857367, 0.519134, -0.417192, 0.941586, -0.080451, -0.848042, 0.211095, -0.772879, 0.89962, 0.423203, 0.512657, 0.319136, 0.45159, -0.624661, 0.753426, 0.435051, 0.529813, -0.230807, 0.888217, -0.166501, 0.465283, 0.651958, 0.519247, -0.225627, 0.382678, -0.629582, 0.551638, 0.929462, 0.314522, 0.614207, 0.823258, 0.56108, 0.86222, 0.19359, 0.244032, -0.378665, -0.005995, -0.292157, 0.168248, -0.429104, 0.014448, -0.882993, -0.234892, 0.514872, -0.502579, 0.118967, 0.07172, -0.850605, -0.607353, -0.138796, 0.331546, -0.847802, -0.932981, 0.084612, 0.010107, 0.32207, 0.801925, 0.997006, 0.326342, -0.226299, -0.748639, -0.730569, 0.262857, 0.413763, 0.066078, 0.089592, 0.27274, -0.05279, -0.45969, 0.459876, -0.440616, -0.584216, 0.786428, -0.973574, 0.061268, 0.092513, -0.567305, -0.81828, -0.918282, 0.664616, -0.575549, 0.971633, -0.982765, -0.632645, -0.800731, -0.21014, 0.826888, -0.155641, 0.144107, -0.920645, -0.991449, -0.000424, 0.300884, 0.1739, 0.015016, -0.977229, 0.095473, -0.747487, -0.04811, -0.136179, 0.468823, 0.927328, -0.555573, -0.527881, 0.645769, -0.477288, 0.346913, 0.293331, -0.322506, -0.486036, 0.944806, -0.511478, 0.899668, -0.303661, 0.873202, 0.723627, -0.538803, -0.541068, -0.667583, -0.461309, 0.929536, 0.935886, 0.219344, 0.039384, 0.043505, 0.921023, 0.774462, -0.165124, 0.534882, -0.491295, 0.64098, 0.91552, -0.657771, -0.558026, -0.790053, -0.191911, -0.308405, -0.04291, -0.448419, 0.21546, -0.242481, 0.808682, -0.01429, -0.20858, 0.441844, -0.943866, 0.320261, 0.523448, 0.585242, 0.090222, 0.800684, 0.112569, 0.30048, -0.66428, 0.752563, 0.22063, 0.918407, -0.76884, 0.825441, -0.044886, -0.039001, -0.828224, 0.433909, -0.700554, -0.84114, -0.65443, 0.292814, 0.275683, 0.124566, 0.551632, -0.010923, 0.678319, 0.628851, -0.458944, 0.800552, -0.397508, 0.98454, -0.965652, -0.20582, 0.820265, -0.132816, -0.278788, -0.856228, 0.139643, 0.703275, -0.322692, -0.338363, 0.378641, -0.28617, 0.101698, 0.433472, 0.068613, -0.148242, -0.466705, 0.738394, -0.410927, 0.984962, 0.405669, 0.125866, -0.982088, 0.955039, 0.845436, -0.745603, 0.446631, 0.78486, 0.369507, -0.380944, 0.883958, 0.268992, 0.106985, 0.97518, -0.222182, 0.831121, 0.946638, -0.357391, -0.347985, 0.787543, 0.209383, 0.476927, -0.374685, 0.693189, 0.60696, -0.978613, 0.289488, 0.943956, 0.035094, -0.89281, 0.105184, -0.666919, 0.304481, -0.955062, 0.925374, 0.157778, -0.468151, -0.31179, -0.012953, 0.164448, -0.656307, 0.343733],
+ shape: [7, 6, 6, 6]
+ },
+ expected: {
+ data: [0.795219, -0.16835, -0.51469, 0.478591, -0.749477, 0.155347, 0.195573, 0.58147, 0.06667, 0.854165, 0.416721, 0.034649, 0.480717, 0.050545, -0.517454, 0.646335, -0.520894, 0.298304, 0.691759, -0.628298, 0.697236, 0.670352, 0.110078, -0.137484, 0.042634, -0.939601, -0.949383, -0.383965, -0.42231, -0.374712, -0.267755, -0.299397, 0.475516, 0.224848, -0.613151, 0.853631],
+ shape: [2, 3, 1, 6]
+ }
+ },
+ 'convolutional.Cropping3D.3': {
+ input: {
+ data: [-0.215694, 0.441215, 0.116911, 0.53299, 0.883562, -0.535525, -0.869764, -0.596287, 0.576428, -0.689083, -0.132924, -0.129935, -0.17672, -0.29097, 0.590914, 0.992098, 0.908965, -0.170202, 0.640203, 0.178644, 0.866749, -0.545566, -0.827072, 0.420342, -0.076191, 0.207686, -0.908472, -0.795307, -0.948319, 0.683682, -0.563278, -0.82135, 0.391356, 0.873557, 0.101774, 0.552487, -0.805471, -0.158387, 0.737777, 0.407663, 0.024323, 0.931444, -0.813418, -0.054911, -0.8488, -0.528392, 0.31073, -0.518975, -0.334317, 0.984459, 0.876118, 0.939272, -0.286813, -0.499695, 0.741409, 0.979405, 0.384731, -0.861441, 0.956879, 0.371096, 0.395767, -0.182768, -0.04864, 0.943523, 0.252702, -0.922957, 0.084044, -0.151514, -0.104476, -0.519114, 0.170185, -0.304221, 0.648458, 0.975786, -0.026504, 0.806763, -0.551306, 0.363744, -0.253539, 0.520681, -0.555914, 0.164078, 0.069617, 0.61564, -0.814065, 0.834879, 0.448904, 0.572477, -0.634663, -0.962277, -0.511182, 0.28331, 0.456662, 0.097291, -0.612782, 0.780788, 0.815368, -0.045092, -0.154594, -0.749131, -0.13425, 0.067759, 0.965334, -0.402963, -0.305027, 0.900762, -0.68091, -0.760497, -0.702999, -0.479565, 0.705878, 0.739556, 0.743407, -0.08787, 0.194838, 0.444586, -0.237847, 0.714397, 0.003476, 0.176333, 0.318089, -0.210574, 0.665183, -0.74621, -0.439604, -0.032897, -0.67171, 0.757381, -0.117032, -0.832812, 0.562207, -0.824057, 0.147708, 0.608499, 0.377938, -0.930702, 0.04294, -0.039472, -0.517352, -0.64207, 0.361295, -0.544495, 0.825223, 0.473357, -0.733994, -0.368548, 0.586403, -0.465342, 0.72613, -0.187859, 0.054425, 0.239031, 0.854588, 0.829812, 0.848903, 0.139064, 0.008025, -0.546984, 0.395519, -0.866557, 0.801336, -0.732569, -0.185929, 0.152884, -0.953483, 0.930523, -0.54922, -0.093218, 0.325075, -0.719152, -0.633034, -0.753904, 0.344891, -0.963772, -0.446026, 0.286814, 0.756519, 0.372178, 0.071732, -0.188247, 0.693894, -0.43033, -0.903031, -0.492189, 0.899836, -0.552368, -0.553622, -0.679484, 0.016195, 0.891604, 0.779606, 0.149406, 0.752016, -0.695177, -0.930224, -0.664835, -0.79635, 0.423615, -0.254402, 0.159415, -0.15244, 0.820635, 0.770241, 0.815006, -0.485857, 0.294987, 0.964034, 0.134613, 0.673378, -0.376272, -0.808101, 0.412723, 0.573529, 0.005777, -0.053066, -0.700318, 0.235987, -0.068263, 0.247649, -0.404731, 0.203814, -0.329107, -0.468369, 0.802557, 0.66231, -0.149117, -0.138193, -0.101905, -0.035625, -0.443804, -0.78221, -0.073352, 0.550544, 0.364402, 0.969535, -0.108104, -0.87979, -0.49984, 0.412514, -0.689554, -0.126264, -0.471823, -0.446719, -0.720356, 0.457369, 0.985619, 0.607835, 0.48972, -0.515463, -0.124945, -0.114273, 0.005033, 0.791923, 0.351923, -0.290373, -0.951029, 0.913971, -0.539169, -0.028312, -0.036768, -0.850635, -0.167548, -0.168993, -0.923405, 0.853735, -0.154032, 0.30117, -0.244491, 0.191919, -0.825866, 0.634476, -0.098177, 0.365853, -0.976385, -0.992225, -0.707116, 0.487679, 0.0492, -0.463333, -0.173074, 0.83129, -0.141277, -0.806725, -0.935533, 0.843659, 0.476078, -0.071665, 0.159787, -0.917204, -0.54939, 0.593851, -0.599885, 0.524063, 0.326937, -0.238377, 0.097153, 0.343496, -0.58839, 0.830905, 0.442858, 0.462174, 0.705181, 0.048056, -0.938781, 0.653592, -0.730406, -0.929912, 0.897714, -0.735706, -0.410101, -0.955015, -0.001601, 0.085032, -0.055787, -0.944858, -0.793914, 0.000563, -0.16397, 0.33181, -0.289269, 0.10943, 0.944269, -0.193446, 0.48286, -0.195952, -0.511226, -0.448196, 0.695966, -0.12916, -0.713753, -0.64093, 0.716985, -0.098099, 0.123401, -0.056109, 0.010111, 0.352437, -0.509194, 0.750921, 0.253841, -0.708165, 0.821124, 0.006613, 0.098428, -0.78475, -0.60798, -0.947196, 0.282283, -0.262235, 0.53522, -0.864729, -0.119298, 0.936872, 0.180087, 0.977898, -0.025644, -0.558908, 0.715291, 0.000521, -0.764904, 0.319351, 0.980566, -0.786352, -0.532971, 0.22349, -0.716549, -0.310122, -0.487408, -0.440706, 0.977597, 0.983465, 0.234706, -0.604104, -0.965578, -0.580777, -0.791097, -0.091303, 0.973252, -0.612431, -0.843771, 0.759226, -0.496212, -0.798771, 0.088759, -0.344253, 0.431093, -0.794068, -0.225465, 0.339765, 0.130517, -0.512642, -0.109772, -0.90458, 0.404718, 0.704574, 0.758276, 0.659395, 0.443485, 0.506577, -0.883215, 0.828717, -0.532839, -0.743989, -0.561542, 0.237909, -0.11387, 0.580675, 0.939269, 0.922755, -0.262718, 0.345844, 0.690802, -0.151282, 0.655477, 0.035601, 0.611308, -0.530814, -0.8206, -0.524242, -0.493136, -0.074615, -0.412433, -0.082067, -0.188891, 0.788821, -0.264136, -0.188681, -0.001166, -0.237385, 0.716098, -0.055445, 0.903261, -0.690342, 0.345747, -0.8422, 0.681083, -0.880773, -0.47829, -0.087262, 0.286764, -0.73948, 0.938692, -0.734384, 0.836267, 0.428397, -0.284466, 0.087184, 0.565192, -0.92756, -0.617862, -0.902012, -0.97077, -0.3262, -0.117703, 0.324541, 0.790994, 0.960735, 0.858284, 0.35247, 0.199395, -0.886025, -0.403741, 0.286867, -0.745825, -0.575954, 0.393387, 0.161558, 0.933436, -0.04139, 0.712661, -0.621411, -0.704434, 0.374135, -0.71425, 0.502797, 0.034642, 0.633788, -0.449388, -0.593975, 0.805345, -0.399393, 0.518122, -0.382023, -0.698987, 0.925711, -0.808321, 0.670118, -0.306688, 0.038679, -0.880873, -0.105844, -0.335898, 0.321574, 0.976045, 0.664659, 0.341049, -0.813552, -0.181204, -0.457684, -0.944205, 0.130818, 0.91465, 0.375795, -0.83426, -0.884669, 0.884202, 0.524805, 0.866177, 0.605792, -0.143796, -0.468536, -0.848138, -0.471953, -0.958303, 0.221358, -0.120887, -0.368682, -0.346116, -0.182678, -0.569586, 0.328268, 0.744066, -0.089028, -0.413939, 0.966069, 0.806133, 0.811337, -0.216864, 0.519711, 0.532548, 0.782122, -0.594866, -0.414185, -0.96614, 0.504274, 0.770258, -0.81789, -0.441714, -0.43652, 0.582823, 0.838065, -0.213008, -0.643435, 0.230493, -0.679991, -0.179979, -0.931999, -0.154311, 0.96013, -0.202379, 0.473898, 0.401901, 0.485608, 0.835172, 0.767556, -0.318512, 0.869208, 0.091651, -0.450239, 0.921468, 0.980922, 0.874128, -0.457308, -0.78107, -0.604558, -0.107902, -0.868826, 0.761486, 0.985782, 0.18808, 0.034727, -0.51135, 0.007318, -0.412556, -0.575671, 0.262399, -0.431255, 0.236753, 0.234476, -0.009731, -0.469543, 0.335344, -0.006414, 0.127297, -0.300389, 0.608195, -0.556598, 0.611592, 0.828308, 0.66101, 0.139477, -0.559037, -0.34807, 0.920787, 0.967347, 0.615015, -0.182736, 0.942934, -0.622099, 0.944364, -0.700525, 0.283057, 0.214233, -0.352612, -0.391157, -0.6866, -0.949089, -0.830036, 0.028655, 0.160321, 0.962427, 0.771235, 0.701332, -0.073448, -0.880306, -0.67372, 0.579104, 0.832739, -0.451863, 0.830591, -0.393846, -0.87822, 0.432681, -0.222904, -0.855099, -0.703505, -0.723594, -0.401981, -0.304913, -0.60108, -0.207273, -0.259013, 0.065798, 0.244318, 0.518287, -0.047123, 0.769841, -0.833204, -0.936774, 0.74598, -0.557437, -0.221576, -0.913191, 0.108353, 0.115733, 0.013277, 0.439679, 0.422073, 0.303912, -0.021176, -0.91273, -0.909738, 0.559815, 0.621811, 0.907303, 0.34733, -0.143574, -0.215208, -0.919455, 0.860239, 0.041072, -0.011693, -0.787824, 0.551498, 0.966032, -0.763429, 0.548998, 0.155827, -0.539245, -0.508795, -0.076923, -0.430267, -0.026247, 0.110006, 0.050526, 0.312362, -0.29318, -0.913974, -0.018903, 0.348191, 0.43283, -0.339458, 0.67296, -0.503704, -0.126925, 0.126921, 0.681079, -0.18157, -0.846449, 0.561337, -0.162773, 0.578579, 0.845398, -0.535639, 0.928576, -0.333678, 0.755441, 0.76015, 0.329895, 0.144662, -0.208612, -0.298499, 0.978054, 0.087719, 0.56864, 0.791894, 0.633447, -0.829405, 0.696793, 0.844902, 0.639941, 0.855367, -0.563831, 0.11538, -0.838183, -0.340807, -0.765973, -0.201738, 0.901256, 0.461485, -0.922959, -0.543252, 0.247037, -0.603098, 0.143447, -0.298636, 0.255228, 0.555237, -0.142739, 0.094639, -0.003793, 0.585846, 0.795219, -0.16835, -0.51469, 0.478591, -0.749477, 0.155347, 0.706903, 0.047964, 0.239316, 0.790049, 0.707638, -0.367523, -0.852255, 0.309914, 0.848387, -0.859448, -0.273302, -0.337586, 0.048332, 0.927994, 0.564126, 0.254753, -0.573478, -0.346197, -0.715717, -0.051958, -0.494504, 0.599351, 0.984027, 0.23743, 0.854292, 0.20021, 0.100571, -0.407464, 0.395228, 0.987905, 0.195573, 0.58147, 0.06667, 0.854165, 0.416721, 0.034649, 0.241931, -0.819904, -0.738848, 0.008158, -0.725937, 0.478754, 0.883892, -0.11895, 0.422474, 0.755278, -0.107855, 0.893582, -0.656121, 0.169792, 0.026624, -0.854244, 0.043245, 0.013092, 0.906277, 0.050616, 0.137537, 0.123879, -0.829904, -0.8344, -0.500271, 0.187797, 0.480912, 0.689756, 0.648658, 0.112738, 0.480717, 0.050545, -0.517454, 0.646335, -0.520894, 0.298304, 0.00373, 0.176349, -0.112375, -0.844539, -0.292901, 0.027739, 0.113266, 0.867302, 0.893293, 0.951617, 0.858295, 0.403715, -0.694067, 0.018322, 0.604787, 0.904331, -0.877118, -0.381556, 0.302968, -0.884946, 0.634482, 0.2684, 0.07795, -0.552023, -0.497385, -0.001392, 0.613874, 0.312707, -0.516964, 0.07461, -0.532681, 0.097518, 0.018129, -0.312512, -0.860073, 0.318977, -0.744195, -0.150664, -0.53404, -0.428665, -0.174314, 0.247514, -0.595893, 0.748659, -0.37269, 0.780516, 0.655175, -0.511935, -0.747456, 0.111773, -0.309556, 0.636038, -0.256566, -0.724825, -0.316549, -0.868989, -0.706117, -0.824815, -0.618301, 0.856392, -0.996149, 0.63829, 0.880169, 0.893699, -0.893984, -0.046652, 0.315952, -0.44143, -0.864354, 0.892476, -0.211045, 0.059187, 0.57039, -0.997778, 0.191066, -0.830022, 0.650504, -0.530842, 0.058659, 0.952869, -0.157372, 0.92573, 0.928522, -0.45409, -0.778338, -0.363509, -0.763773, 0.679892, 0.241852, 0.351275, -0.258137, 0.395351, -0.381122, 0.709346, 0.375105, 0.28349, -0.151699, -0.887474, -0.980568, -0.84615, 0.90203, 0.770327, 0.159608, -0.959841, 0.784576, 0.545309, 0.493765, -0.27253, 0.655846, 0.553353, 0.152227, 0.438126, 0.987307, 0.403776, -0.232088, -0.605441, -0.090541, -0.189261, -0.999625, 0.538246, 0.532891, -0.374952, -0.508505, 0.346032, -0.344552, -0.550043, -0.935551, -0.99107, -0.301938, -0.168825, 0.35326, -0.599303, -0.654331, -0.261841, -0.571388, 0.698991, -0.078255, -0.195565, 0.691759, -0.628298, 0.697236, 0.670352, 0.110078, -0.137484, -0.965838, 0.499479, -0.931003, 0.565995, -0.289345, 0.171825, 0.893263, -0.698565, 0.106203, 0.78723, -0.507623, 0.23409, -0.072888, 0.972045, -0.156797, -0.18569, -0.816269, 0.086552, -0.862185, 0.977191, -0.818147, -0.917344, -0.578661, 0.216002, 0.390336, 0.227703, 0.962969, 0.885609, -0.2223, 0.669628, 0.042634, -0.939601, -0.949383, -0.383965, -0.42231, -0.374712, 0.387369, 0.646834, 0.872373, -0.217432, -0.860018, -0.730193, -0.842808, -0.088775, -0.45984, -0.641785, 0.361352, 0.617324, 0.281634, -0.267519, -0.104152, 0.065566, 0.638451, -0.99023, 0.122453, -0.581285, -0.84508, -0.213483, -0.018054, -0.2835, 0.951819, 0.731384, -0.241599, -0.941958, -0.47496, -0.704789, -0.267755, -0.299397, 0.475516, 0.224848, -0.613151, 0.853631, -0.285596, -0.984425, -0.004342, -0.558075, -0.498553, 0.272694, 0.068413, 0.598389, -0.558155, -0.463243, 0.118942, 0.392428, 0.585269, 0.559008, 0.509983, -0.719725, 0.899859, -0.054641, 0.56467, -0.088496, -0.246774, -0.909083, -0.635166, -0.180455, -0.566009, -0.304824, -0.337654, -0.28894, -0.930163, -0.180485, -0.515424, 0.710147, -0.606524, 0.985967, 0.888985, 0.645856, 0.745228, 0.442467, -0.309917, 0.726975, 0.019567, -0.140183, 0.614124, -0.856526, -0.568601, -0.90666, -0.746201, 0.89231, 0.328027, 0.670873, 0.772824, -0.249407, -0.225128, -0.309643, 0.055451, 0.397084, -0.015763, -0.104947, 0.946976, 0.373816, -0.485013, 0.004047, -0.892327, 0.812327, 0.013913, 0.817028, -0.083667, 0.727218, -0.856644, 0.181954, -0.947651, 0.517506, 0.385722, -0.222445, -0.129355, -0.155133, -0.186532, 0.134046, -0.181235, 0.701509, 0.10727, -0.223625, 0.990662, -0.071366, 0.751143, 0.855357, 0.084802, -0.832278, -0.053375, -0.19636, -0.903927, 0.513069, 0.618, -0.530257, 0.910113, -0.970662, 0.740255, -0.542166, 0.70816, 0.340971, 0.015036, -0.561873, -0.576902, 0.959876, -0.552993, 0.25889, -0.901, 0.269618, 0.946302, 0.943612, 0.326183, -0.988706, 0.354102, 0.675289, -0.567086, -0.11179, 0.792741, -0.225879, 0.084516, -0.663273, -0.006569, -0.602323, -0.837099, 0.090505, 0.058281, 0.048858, -0.123648, 0.270346, -0.663069, 0.261073, 0.202716, -0.108538, 0.08633, -0.588139, 0.245405, 0.370942, -0.920384, -0.283831, 0.181426, 0.215151, 0.286008, 0.068399, 0.495306, 0.582592, 0.961226, 0.388063, 0.164688, 0.940278, 0.246888, -0.365183, -0.985746, 0.680361, -0.70754, -0.638368, -0.194461, 0.012646, -0.833634, -0.946438, -0.317705, -0.936933, -0.114303, -0.200694, 0.869011, 0.605997, 0.160927, -0.226291, -0.443921, 0.170021, -0.678198, -0.008692, -0.866096, 0.473826, 0.008789, -0.907462, 0.227272, -0.774721, 0.275255, -0.17879, 0.297924, 0.190216, 0.796589, 0.564772, 0.676277, 0.347743, 0.993239, -0.800231, -0.825401, 0.604841, -0.078256, -0.981104, -0.590065, -0.690202, -0.140628, -0.281607, 0.13361, 0.487755, 0.703334, -0.048199, -0.729918, 0.638745, -0.930051, 0.792881, 0.560942, 0.984295, -0.026256, -0.807647, 0.037724, -0.883297, 0.527074, -0.058281, -0.343332, 0.832498, -0.823443, -0.868069, -0.665845, -0.68803, -0.204482, -0.56854, 0.589662, -0.68208, -0.711295, -0.324815, -0.363985, -0.141501, 0.180616, 0.098551, 0.356221, 0.76361, -0.495118, -0.619777, 0.267608, 0.089808, 0.008487, 0.674874, -0.490058, 0.251746, 0.422547, 0.257684, 0.125063, -0.211933, -0.5837, 0.899513, -0.843382, 0.809206, 0.015723, 0.099545, 0.847903, 0.857367, 0.519134, -0.417192, 0.941586, -0.080451, -0.848042, 0.211095, -0.772879, 0.89962, 0.423203, 0.512657, 0.319136, 0.45159, -0.624661, 0.753426, 0.435051, 0.529813, -0.230807, 0.888217, -0.166501, 0.465283, 0.651958, 0.519247, -0.225627, 0.382678, -0.629582, 0.551638, 0.929462, 0.314522, 0.614207, 0.823258, 0.56108, 0.86222, 0.19359, 0.244032, -0.378665, -0.005995, -0.292157, 0.168248, -0.429104, 0.014448, -0.882993, -0.234892, 0.514872, -0.502579, 0.118967, 0.07172, -0.850605, -0.607353, -0.138796, 0.331546, -0.847802, -0.932981, 0.084612, 0.010107, 0.32207, 0.801925, 0.997006, 0.326342, -0.226299, -0.748639, -0.730569, 0.262857, 0.413763, 0.066078, 0.089592, 0.27274, -0.05279, -0.45969, 0.459876, -0.440616, -0.584216, 0.786428, -0.973574, 0.061268, 0.092513, -0.567305, -0.81828, -0.918282, 0.664616, -0.575549, 0.971633, -0.982765, -0.632645, -0.800731, -0.21014, 0.826888, -0.155641, 0.144107, -0.920645, -0.991449, -0.000424, 0.300884, 0.1739, 0.015016, -0.977229, 0.095473, -0.747487, -0.04811, -0.136179, 0.468823, 0.927328, -0.555573, -0.527881, 0.645769, -0.477288, 0.346913, 0.293331, -0.322506, -0.486036, 0.944806, -0.511478, 0.899668, -0.303661, 0.873202, 0.723627, -0.538803, -0.541068, -0.667583, -0.461309, 0.929536, 0.935886, 0.219344, 0.039384, 0.043505, 0.921023, 0.774462, -0.165124, 0.534882, -0.491295, 0.64098, 0.91552, -0.657771, -0.558026, -0.790053, -0.191911, -0.308405, -0.04291, -0.448419, 0.21546, -0.242481, 0.808682, -0.01429, -0.20858, 0.441844, -0.943866, 0.320261, 0.523448, 0.585242, 0.090222, 0.800684, 0.112569, 0.30048, -0.66428, 0.752563, 0.22063, 0.918407, -0.76884, 0.825441, -0.044886, -0.039001, -0.828224, 0.433909, -0.700554, -0.84114, -0.65443, 0.292814, 0.275683, 0.124566, 0.551632, -0.010923, 0.678319, 0.628851, -0.458944, 0.800552, -0.397508, 0.98454, -0.965652, -0.20582, 0.820265, -0.132816, -0.278788, -0.856228, 0.139643, 0.703275, -0.322692, -0.338363, 0.378641, -0.28617, 0.101698, 0.433472, 0.068613, -0.148242, -0.466705, 0.738394, -0.410927, 0.984962, 0.405669, 0.125866, -0.982088, 0.955039, 0.845436, -0.745603, 0.446631, 0.78486, 0.369507, -0.380944, 0.883958, 0.268992, 0.106985, 0.97518, -0.222182, 0.831121, 0.946638, -0.357391, -0.347985, 0.787543, 0.209383, 0.476927, -0.374685, 0.693189, 0.60696, -0.978613, 0.289488, 0.943956, 0.035094, -0.89281, 0.105184, -0.666919, 0.304481, -0.955062, 0.925374, 0.157778, -0.468151, -0.31179, -0.012953, 0.164448, -0.656307, 0.343733],
+ shape: [7, 6, 6, 6]
+ },
+ expected: {
+ data: [0.665183, -0.117032, 0.377938, 0.750921, -0.78475, -0.864729, 0.767556, 0.980922, -0.868826, 0.06667, -0.738848, 0.422474, -0.949383, 0.872373, -0.45984, 0.275255, 0.676277, -0.078256, -0.943866, 0.112569, -0.76884],
+ shape: [7, 1, 3, 1]
+ }
+ }
+ }
+
+ window.TEST_DATA = Object.assign({}, window.TEST_DATA, DATA)
+})()
diff --git a/test/index.html b/test/index.html
index 9381735..63e0a09 100644
--- a/test/index.html
+++ b/test/index.html
@@ -71,6 +71,12 @@
+
+
+
+
+
+