Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

TensorFlow.js Visor

  • TensorFlow Visor 是一个用于可视化机器学习的图形工具
  • 它包含用于可视化TensorFlow 模型的功能
  • 可视化结果可以组织在Visor(模态浏览器窗口)中
  • 可以与自定义工具(如 d3、Chart.js 和 Plotly.js)一起使用
  • 通常称为tfjs-vis

使用 tfjs-vis

要使用 tfjs-vis,请将以下脚本标签添加到您的 HTML 文件中

示例

<script src="https://cdn.jsdelivr.net.cn/npm/@tensorflow/tfjs-vis"></script>

散点图

示例

const surface = document.getElementById('demo');
const series = ['第一组', '第二组'];

const serie1 = [];
const serie2 = [];
for (let i = 0; i < 100; i++) {
  serie1[i] = {x:i, y:Math.random() * 100};
  serie2[i] = {x:i, y:Math.random() * 100};
}

const data = {values: [serie1, serie2], series}

tfvis.render.scatterplot(surface, data);

自己试试 »

可视化结果可以组织在 Visor(模态浏览器窗口)中

带有 Visor 的示例

const series = ['第一组', '第二组'];

const serie1 = [];
const serie2 = [];
for (let i = 0; i < 100; i++) {
  serie1[i] = {x:i, y:Math.random() * 100};
  serie2[i] = {x:i, y:Math.random() * 100};
}

const data = {values: [serie1, serie2], series}

tfvis.render.scatterplot({name: "我的图表"}, data);

自己试试 »



条形图

示例

const surface = document.getElementById('demo');
const data = [
  {index: 0, value: 100},
  {index: 1, value: 200},
  {index: 2, value: 150},
  {index: 2, value: 250},
];

tfvis.render.barchart(surface, data);

自己试试 »

可视化结果可以组织在 Visor(模态浏览器窗口)中

带有 Visor 的示例

const data = [
  {index: 0, value: 100},
  {index: 1, value: 200},
  {index: 2, value: 150},
  {index: 2, value: 250},
];

tfvis.render.barchart({name:"我的图表"}, data);

自己试试 »


折线图

示例

const surface = document.getElementById('demo');

let values = [
  {x: 1, y: 20},
  {x: 2, y: 30},
  {x: 3, y: 5},
  {x: 4, y: 12}
];

tfvis.render.linechart(surface, {values});

自己试试 »

可视化结果可以组织在 Visor(模态浏览器窗口)中

带有 Visor 的示例

let values = [
  {x: 1, y: 20},
  {x: 2, y: 30},
  {x: 3, y: 5},
  {x: 4, y: 12}
];

tfvis.render.linechart({name: '我的折线'}, {values});

自己试试 »


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.