TensorFlow.jsバイザー

  • TensorFlow Visorは、機械学習を視覚化するためのグラフィックツールです
  • TensorFlowモデルを視覚化するための関数が含まれています
  • 視覚化はバイザー(モーダルブラウザウィンドウ)で整理できます
  • d3、Chart.js、Plotly.jsなどのカスタムツールで使用できます
  • しばしばtfjs-visと呼ばれます

tfjs-visを使用する

tfjs-visを使用するには、次のスクリプトタグをHTMLファイルに追加します。

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

散布図

const surface = document.getElementById('demo');
const series = ['First', 'Second'];

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(モーダルブラウザウィンドウ)で整理できます。

バイザーの例

const series = ['First', 'Second'];

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: "my Plots"}, 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(モーダルブラウザウィンドウ)で整理できます。

バイザーの例

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

tfvis.render.barchart({name:"my Graphs"}, 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(モーダルブラウザウィンドウ)で整理できます。

バイザーの例

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

tfvis.render.linechart({name: 'my Lines'}, {values});