Export¶
Model export to standard interchange formats.
ONNXExporter— Export SC networks to ONNX (.onnxprotobuf) or JSON (.jsonlegacy). SC layers map to custom domainsc_neurocorewith op typesSC_DenseandSC_Custom. Standard layers use ONNX standard ops.
Two export paths:
- .onnx — Standard ONNX ModelProto via the onnx library (optional dependency)
- .json — Dependency-free JSON schema for lightweight deployment
from sc_neurocore.export import ONNXExporter
exporter = ONNXExporter()
exporter.export(model, "model.onnx")
sc_neurocore.export.onnx_exporter
¶
ONNX export for SC networks.
Supports two formats:
- .onnx (protobuf) — standard ONNX ModelProto via onnx library
- .json — legacy JSON schema (no external dependencies)
SC layers use stochastic bitstream ops not in the ONNX standard.
We map them to a custom domain sc_neurocore with op types
SC_Dense and SC_Custom.
SCOnnxExporter
¶
Export SC networks to ONNX protobuf or legacy JSON.
Source code in src/sc_neurocore/export/onnx_exporter.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
export(layers, filename)
staticmethod
¶
Export layers to filename.
File extension selects format: .onnx → protobuf,
anything else → legacy JSON.
Source code in src/sc_neurocore/export/onnx_exporter.py
43 44 45 46 47 48 49 50 51 52 53 | |