tensorflow-helpers
Version:
Helper functions to use tensorflow in nodejs for transfer learning, image classification, and more
25 lines (24 loc) • 754 B
TypeScript
import type { GraphModel, Tensor } from '@tensorflow/tfjs';
export declare function getSpatialNodeNames(model: GraphModel): {
name: string;
layer: number;
}[];
export declare function getLastSpatialNodeName(model: GraphModel): string;
export type SpatialNode = {
name: string;
layer: number;
shape: number[];
};
export declare function getSpatialNodes(args: {
model: GraphModel;
tf: {
zeros: (shape: number[]) => Tensor;
};
}): SpatialNode[];
export declare function filterSpatialNodesWithUniqueShapes(spatialNodes: SpatialNode[]): SpatialNode[];
export declare function getSpatialNodesWithUniqueShapes(args: {
model: GraphModel;
tf: {
zeros: (shape: number[]) => Tensor;
};
}): SpatialNode[];