examples.0.4.source-code.ExampleVisualizeNetwork Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of examples Show documentation
Show all versions of examples Show documentation
Trainer Agnostic Deep Learning
import deepboof.Function;
import deepboof.datasets.UtilCifar10;
import deepboof.graph.FunctionSequence;
import deepboof.io.torch7.ParseBinaryTorch7;
import deepboof.io.torch7.SequenceAndParameters;
import deepboof.tensors.Tensor_F32;
import deepboof.visualization.DeepVisulization;
import deepboof.visualization.SequentialNetworkDisplay;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.List;
/**
* @author Peter Abeles
*/
public class ExampleVisualizeNetwork {
public static void main(String[] args) throws IOException {
File modelHome = UtilCifar10.downloadModelVggLike(new File("data/torch_models"));
System.out.println("Load and convert to DeepBoof");
SequenceAndParameters> sequence =
new ParseBinaryTorch7().parseIntoBoof(new File(modelHome,"model.net"));
FunctionSequence> network = sequence.createForward(3,32,32);
SequentialNetworkDisplay gui = new SequentialNetworkDisplay((List)network.getSequence());
JScrollPane scrollPane = new JScrollPane(gui);
scrollPane.setPreferredSize(new Dimension(400,800));
DeepVisulization.showWindow(scrollPane,"Network",true);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy