Skip to content

Instantly share code, notes, and snippets.

@utilForever
Created February 12, 2019 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utilForever/1e0a93263ff5d52ae35304906e9c980a to your computer and use it in GitHub Desktop.
Save utilForever/1e0a93263ff5d52ae35304906e9c980a to your computer and use it in GitHub Desktop.
CubbyDNN graph sample code
using Tensor = Tensor<float>;
Graph g;
auto& input = g.Input(TensorShape(64, 32));
auto& oneHot = g.Reshape(input, TensorShape(1, 2048));
auto& output = g.DropOut(oneHot, 10);
auto& answer = g.Max(result);
for (int i = 0; i < trainNum; ++i)
{
data = LoadData("dataPath");
g.ImportData(data[i]);
Tensor answer = g.Run();
std::cout << "the answer is" << answer << std::endl;
}
@utilForever
Copy link
Author

utilForever commented Feb 13, 2019

@Ravenwater I have not yet decided what operations are required in Graph class. I referenced test code in the following library.
https://github.com/AcrylicShrimp/TinNet/blob/master/Example_Graph_Basic/Run.cpp
I'm curious about it you are suggesting. This part needs a lot of discussion and I want to take a few comments and go a little better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment