Skip to content

Commit

Permalink
Merge pull request #24 from neuroneural/sequential_output_fix01
Browse files Browse the repository at this point in the history
Sequential output fix01
  • Loading branch information
Mmasoud1 authored Feb 3, 2024
2 parents b12fec8 + 7da1106 commit 25c6c7a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions js/brainchop/mainMeshNetFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4151,7 +4151,8 @@ class SequentialConvLayer {
// Important to avoid "undefined" class var members inside the timer.
// "this" has another meaning inside the timer.

document.getElementById("progressBarChild").parentElement.style.visibility = "visible";
// *** WARNING!!! if you uncomment this line the memory leak will break webGL and may reboot your machine
//document.getElementById("progressBarChild").parentElement.style.visibility = "visible";

return new Promise((resolve, reject) => {

Expand Down Expand Up @@ -4193,27 +4194,32 @@ class SequentialConvLayer {
});

// -- await showMemStatus(chIdx, self.outChannels);

// Log memory usage
const memoryInfo = tf.memory();
console.log(`Iteration ${chIdx}:`);
console.log(`Number of Tensors: ${memoryInfo.numTensors}`);
console.log(`Number of Data Buffers: ${memoryInfo.numDataBuffers}`);
console.log(`Bytes In Use: ${memoryInfo.numBytes}`);
console.log(`Megabytes In Use: ${(memoryInfo.numBytes / 1048576).toFixed(3)} MB`);
console.log(`Unreliable: ${memoryInfo.unreliable}`);
// Assign the new values to outC and outB
outC = result[0];
outB = result[1];

if(chIdx == (self.outChannels -1)) {

window.clearInterval( seqTimer );
document.getElementById("progressBarChild").style.width = 0 + "%";
// *** WARNING!!! if you uncomment this line the memory leak will break webGL and may reboot your machine
// document.getElementById("progressBarChild").style.width = 0 + "%";
tf.dispose(outB);
const endTime = performance.now();
const executionTime = endTime - startTime;
console.log(`Execution time for output layer: ${executionTime} milliseconds`);
resolve(outC);
} else {

chIdx++;
document.getElementById("progressBarChild").style.width = (chIdx + 1)*100/self.outChannels + "%";
}


chIdx++;
// *** WARNING!!! if you uncomment this line the memory leak will break webGL and may reboot your machine
//document.getElementById("progressBarChild").style.width = (chIdx + 1)*100/self.outChannels + "%";
}, 10);
});

Expand Down
Binary file modified paper/paper.pdf
Binary file not shown.

0 comments on commit 25c6c7a

Please sign in to comment.