Comments (4)
Yes, currently our only documentation are the Readme and comments in the code.
Afaik, tinydnn's convolutional layer supports the same parameters as our Conv2D, so I suppose you would want to instantiate a CompiledNN model with just that one layer.
The problem is though that we currently only support loading Keras models without the possibility of constructing a Model yourself, which admittedly is a needless constraint.
from compilednn.
I think the only extra parameter in tiny_dnn would be dilation, which I saw somewhere is not supported in CompiledNN. But that's ok as most of our layers have no dilation.
I thought I could use the Conv2DCompiler class directly, but I couldn't figure out how. I looked at https://github.com/bhuman/CompiledNN/blob/master/Src/CompiledNN/CompiledNN.cpp#L160 as well.
from compilednn.
You can also compile a single node, see for example https://github.com/bhuman/CompiledNN/blob/master/Tests/Layers/UpSampling2D.cpp. I have an unfinished Conv2D test, this an excerpt from it:
static const Node& buildNode(Conv2DLayer* l, const std::array<unsigned int, 2>& strides, const std::array<unsigned int, 2>& kernelSize,
bool hasBiases, ActivationFunctionId activation, PaddingType padding, unsigned int filters,
unsigned int height, unsigned int width, unsigned int channels)
{
l->nodes.clear();
l->strides = strides;
l->weights.reshape(kernelSize[0], kernelSize[1], channels, filters);
l->biases.resize(hasBiases ? filters : 0);
l->hasBiases = hasBiases;
l->activationId = activation;
l->padding = padding;
l->nodes.emplace_back(l);
Node& n = l->nodes.back();
n.inputs.emplace_back(nullptr, 0, 0);
n.inputDimensions.push_back({height, width, channels});
l->calcOutputDimensions(n);
for(std::size_t i = 0; i < n.outputDimensions.size(); ++i)
n.outputs.emplace_back(l, 0, i);
return n;
}
called by
CompiledNN c;
Conv2DLayer l;
const Node& n = buildNode(&l, {stride, stride}, {kernelSize, kernelSize}, true, ...);
// ... copy weights to l.weights, copy biases to l.biases
c.compile(n, CompilationSettings());
// ... fill c.input(0)
c.apply();
// ... obtain output from c.output(0)
from compilednn.
oh fantastic. i will figure out how to make this work as a tiny_dnn layer and report back.
from compilednn.
Related Issues (20)
- CompiledNN/Src/Model.cpp:300: ASSERT(result) failed HOT 6
- 'Platform/BHAssert.h' file not found HOT 2
- build failed HOT 6
- ASSERT(input.dims(2) <= settings.xmmRegs() * 4) failed HOT 2
- Testing
- Conv2D: canBeInplace-condition is wrong
- Conv2D: biasOffset thing is not working
- Softmax: support multi-dimensional tensors and an arbitrary softmax axis
- GlobalPooling2D: support an arbitrarily large channel dimension
- Segmentation Fault in Tensor.h:225 HOT 1
- Finish Im2Col implementation
- Implement Conv1x1
- Fuse BatchNormalization followed by (D)Conv2D
- DConv2D does not work for channel numbers that are not multiples of 4 or do not fit into SSE registers
- Quantization
- Fusing UInt8Input+BatchNormalization only works if number of channels is a multiple of 4 HOT 1
- Installation fails HOT 1
- Onnx support HOT 2
- Support Conv1D and MaxPooling1D
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compilednn.