SameDiff
Automatic differentiation framework in ND4J — define-and-run computation graphs, comparison with MultiLayerNetwork and ComputationGraph
What SameDiff Is
SameDiff sd = SameDiff.create();
SDVariable x = sd.placeHolder("x", DataType.FLOAT, -1, 784);
SDVariable w = sd.var("w", DataType.FLOAT, 784, 10);
SDVariable b = sd.var("b", DataType.FLOAT, 10);
SDVariable logits = x.mmul(w).add(b);
SDVariable output = sd.nn.softmax("output", logits);Automatic Gradient Computation
Key Classes
Class
Role
When to Use SameDiff vs MultiLayerNetwork / ComputationGraph
MultiLayerNetwork
ComputationGraph
SameDiff
Building a Simple Neural Net in SameDiff
Step 1: Define the graph
Step 2: Configure training
Step 3: Train
Step 4: Run inference
How the Graph Executes
Graph Inspection
Thread Safety and Multiple Graphs
Next Steps
Last updated
Was this helpful?