function compareInputDeltas3D(inputDeltas, deltas, filters) { let sum = 0; const filterX = this.thread.x + this.thread.y * this.output.x; for (let filterY = 0; filterY < this.constants.filterCount; filterY++) { sum += filters[filterY][filterX] * deltas[0][filterY]; } return sum + inputDeltas[this.thread.z][this.thread.y][this.thread.x]; }
new TWEEN.Tween(point) .to( {x: point.x*altitude, y: point.y*altitude, z: point.z*altitude}, 1500 ) .easing( TWEEN.Easing.Elastic.Out ) .onUpdate(function(){ _this.lineGeometry.vertices[1].x = this.x; _this.lineGeometry.vertices[1].y = this.y; _this.lineGeometry.vertices[1].z = this.z; _this.lineGeometry.verticesNeedUpdate = true; }).start();
function inputZYX(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a) { return a[this.thread.z][this.thread.y][this.thread.x]; }) .setOutput([2, 4, 4]); const a = new Float32Array(32); a.set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]); const result = kernel(input(a, [2, 4, 4])); assert.deepEqual(result.map(function(v) { return v.map(function(v) { return Array.from(v); }); }), [[[1,2],[3,4],[5,6],[7,8]],[[9,10],[11,12],[13,14],[15,16]],[[17,18],[19,20],[21,22],[23,24]],[[25,26],[27,28],[29,30],[31,32]]]); gpu.destroy(); }
// Texture fixing helper. Spheres have some odd behaviours. function correctUV( uv, vector, azimuth ) { if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new THREE.Vector2( uv.x - 1, uv.y ); if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.Vector2( azimuth / 2 / Math.PI + 0.5, uv.y ); return uv.clone(); }
function predict3D(exponentials, exponentialsSum) { return ( exponentials[this.thread.z][this.thread.y][this.thread.x] / exponentialsSum[0] ); }
function predict3D(inputs) { return ( 1 / (1 + Math.exp(-inputs[this.thread.z][this.thread.y][this.thread.x])) ); }
// Texture fixing helper. Spheres have some odd behaviours. function correctUV( uv, vector, azimuth ) { if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new THREE.Vector2( uv.x - 1, uv.y ); if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.Vector2( azimuth / 2 / Math.PI + 0.5, uv.y ); return uv.clone(); }