Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need some information on using NeuralNetworkVis #1484

Open
devihall opened this issue Apr 11, 2024 · 4 comments
Open

Need some information on using NeuralNetworkVis #1484

devihall opened this issue Apr 11, 2024 · 4 comments

Comments

@devihall
Copy link

devihall commented Apr 11, 2024

β†’ Issue Description πŸ“

Need some information on using NeuralNetworkVis
I see from the documentation that using debug:true provides a visor with loss graph and model summary by default. However I'm trying to get some other visualizations such as Confusion Matrix, and Accuracy graph for training data and validation data.

I noticed on the Github repo Confusion Matrix is commented out.

Is this not available yet?

Also do I need to initialize this property like I have done here?

const nn = ml5.neuralNetwork(options);
const vis = nn.neuralNetworkVis;

β†’ Step 2: Screenshots or Relevant Documentation πŸ–Ό

Here's a screenshots of the commented code on the ml5 repo :

Screenshot 2024-04-11 at 12 47 25β€―PM

β†’ Step 3: Share an example of the issue πŸ¦„

Here's an example of my code implementation:

I'm trying to append the graphs to the DOM instead of using a visor and this is how I'm implementing this functionality.

Is this an appropriate way to achieve this?

function whileTraining(epoch, loss) {
    
console.log("Loss obj only:", loss);
console.log(`Epoch ${epoch}, Loss: ${loss.loss}`);

//   Accumulate loss data
  trainingLossData.push({ x: epoch, y: loss.loss });
    validationLossData.push({ x: epoch, y: loss.val_loss});


  // Visualize the accumulated loss data
  const trainingLossGraph = {
    values: trainingLossData,
    series: ["Training Loss/Validation Loss vs Epoch"],
  };

  const validationLossGraph = {
    values: trainingLossData,
    series: ["Training Loss vs Epoch"],
  };

  const container = document.getElementById("loss-chart");
  const options = {
    xLabel: "Epoch",
    yLabel: "Loss",
  };
  tfvis.render.linechart(container, trainingLossGraph, options);
}

Other relevant information, if applicable

β†’ Describe your setup πŸ¦„

Here's some helpful information about my setup...

  • Web browser & version:
  • Google Chrome
  • Operating System:
  • MacBook Pro Apple M1
  • Mac OS 14.4 (23E214)
  • ml5 version -latest:
@devihall
Copy link
Author

devihall commented Apr 23, 2024

Hey ml5 team! Just wondering if yall had a chance to look into this. Thanks so much for all your fantastic work on this library. @bomanimc @shiffman

@shiffman
Copy link
Member

shiffman commented May 3, 2024

Hi @devihall, my apologies! We're working to archive/deprecate this repo, the work of ml5.js is continuing in ml5-next-gen. The ml5.js library only provides a very basic defualt behavior for the tf.js visor, to expand the capabilities you likely need to work with tensorflow.js directly? We have a discord if you want to join and ask questions there! https://discord.gg/32X2smhx

@devihall
Copy link
Author

devihall commented May 6, 2024

Hi @devihall, my apologies! We're working to archive/deprecate this repo, the work of ml5.js is continuing in ml5-next-gen. The ml5.js library only provides a very basic defualt behavior for the tf.js visor, to expand the capabilities you likely need to work with tensorflow.js directly? We have a discord if you want to join and ask questions there! https://discord.gg/32X2smhx

@shiffman Thanks for your response! What happens to our app one this repo gets deprecated? we are using ml5 extensively

@shiffman
Copy link
Member

shiffman commented May 7, 2024

@shiffman Thanks for your response! What happens to our app one this repo gets deprecated? we are using ml5 extensively

This repo will remain online as well as all the existing and previous versions of ml5.js! Just make sure you are tagging a specific version of ml5 in your project rather than just @latest.

The goal for the updated ml5.js "next generation" is to include any and all of the important and useful features of current ml5.js. What features and functions are you currently using for your work?

The one we have yet to re-implement is the "feature classifier" but that should be coming soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants