1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | import { Scalar, Tensor } from '@tensorflow/tfjs';
|
18 | import { NodeJSKernelBackend } from './nodejs_kernel_backend';
|
19 | export declare class SummaryFileWriter {
|
20 | private readonly resourceHandle;
|
21 | backend: NodeJSKernelBackend;
|
22 | constructor(resourceHandle: Tensor);
|
23 | /**
|
24 | * Write a scalar summary.
|
25 | *
|
26 | * @param name A name of the summary. The summary tag for TensorBoard will be
|
27 | * this name.
|
28 | * @param value A real numeric scalar value, as `tf.Scalar` or a JavaScript
|
29 | * `number`.
|
30 | * @param step Required `int64`-castable, monotically-increasing step value.
|
31 | * @param description Optinal long-form description for this summary, as a
|
32 | * `string`. *Not implemented yet*.
|
33 | */
|
34 | scalar(name: string, value: Scalar | number, step: number, description?: string): void;
|
35 | /**
|
36 | * Force summary writer to send all buffered data to storage.
|
37 | */
|
38 | flush(): void;
|
39 | }
|
40 | /**
|
41 | * Create a summary file writer for TensorBoard.
|
42 | *
|
43 | * Example:
|
44 | * ```js
|
45 | * const tf = require('@tensorflow/tfjs-node');
|
46 | *
|
47 | * const summaryWriter = tf.node.summaryFileWriter('/tmp/tfjs_tb_logdir');
|
48 | *
|
49 | * for (let step = 0; step < 100; ++step) {
|
50 | * summaryWriter.scalar('dummyValue', Math.sin(2 * Math.PI * step / 8), step);
|
51 | * }
|
52 | * ```
|
53 | *
|
54 | * @param logdir Log directory in which the summary data will be written.
|
55 | * @param maxQueue Maximum queue length (default: `10`).
|
56 | * @param flushMillis Flush every __ milliseconds (default: `120e3`, i.e,
|
57 | * `120` seconds).
|
58 | * @param filenameSuffix Suffix of the protocol buffer file names to be
|
59 | * written in the `logdir` (default: `.v2`).
|
60 | * @returns An instance of `SummaryFileWriter`.
|
61 | */
|
62 | /**
|
63 | * @doc {heading: 'TensorBoard', namespace: 'node'}
|
64 | */
|
65 | export declare function summaryFileWriter(logdir: string, maxQueue?: number, flushMillis?: number, filenameSuffix?: string): SummaryFileWriter;
|
66 |
|
\ | No newline at end of file |