@wetron/keras
v0.0.35
Published
Keras model parser - extracts graph structure from .keras archive files
Downloads
671
Maintainers
Readme
@wetron/keras
Keras model parser for wetron. Reads .keras ZIP archive files and returns a ModelGraph IR. Supports Sequential and Functional model classes. Graph structure only - no weight tensors are deserialized.
Install
pnpm add @wetron/kerasIncluded automatically when you install @wetron/core or @wetron/react.
API
import { parseKeras } from "@wetron/keras";
const bytes = new Uint8Array(await file.arrayBuffer());
const graph = parseKeras(bytes); // synchronousThrows ParseError from @wetron/common/ir on malformed input, missing config.json, or unsupported model class.
What gets parsed
config.jsoninside the.kerasZIP archiveSequentialandFunctionalmodel classes- Layer
class_name->opType, layerconfig-> nodeattributes - Edges resolved from
inbound_nodesfor Functional models; chained sequentially for Sequential models - Input shapes from
InputLayerbatch shapes
Notes
- Weight data lives in separate
.weights.h5files - not parsed. ModelGraph.initializersis always empty.
