Jihoon Lee [Wed, 7 Apr 2021 06:27:38 +0000 (15:27 +0900)]
[Loader] Remove functions which has been moved
Remove functions that has been moved to `ini_interpreter`
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Wed, 7 Apr 2021 04:28:35 +0000 (13:28 +0900)]
[Loader] Use ini interpreter for the graph
This patch substitues graph parsing part to use interpreter.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Mon, 5 Apr 2021 12:12:35 +0000 (21:12 +0900)]
[IniInterpreter] Add test setup
This patch add a test setup to test interpreter.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Mon, 5 Apr 2021 09:56:45 +0000 (18:56 +0900)]
[IniInterpreter] Add ini backbone deserialization
**Changes proposed in this PR:**
- Add ini backbone deserialization support
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Mon, 5 Apr 2021 07:59:55 +0000 (16:59 +0900)]
[IniInterpreter] Add section2layer
This patch add plain `section2layer`.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Mon, 5 Apr 2021 07:11:03 +0000 (16:11 +0900)]
[Ini] Implement ini deserializer
This patch implements ini deserializer as well as changing the interface
signature to get filepath.
Many NYI parts will be implemented soon.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
jijoong.moon [Mon, 5 Apr 2021 04:12:45 +0000 (13:12 +0900)]
[ TIME DIST ] Implement initialization
This commit includes,
- Implementation of Time Distribute Layer Initialization.
Resolves:
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Thu, 1 Apr 2021 07:42:42 +0000 (16:42 +0900)]
[ TIME DIST ] Add skeleton Code for Time Distribution Layer
This includes
. Skeleton Code for Time Distribution Layer
Resolves:
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Thu, 1 Apr 2021 07:42:42 +0000 (16:42 +0900)]
[ TIME DIST ] Add skeleton Code for Time Distribution Layer
This includes
. Skeleton Code for Time Distribution Layer
Resolves:
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Thu, 1 Apr 2021 02:37:21 +0000 (11:37 +0900)]
[ LSTM ] Layer forwarding implementation
This commit includes:
. implementation of lstm forwarding implementation
Resolves:
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Thu, 1 Apr 2021 02:35:34 +0000 (11:35 +0900)]
[ RNN ] Fix the bug when getting input data
This commit fix:
Using wrong tensor to get input vector.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Wed, 31 Mar 2021 12:48:25 +0000 (21:48 +0900)]
[ LSTM ] Layer Initialization
This commit includes
. LSTM Layer initialization
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
hyeonseok lee [Tue, 6 Apr 2021 12:29:31 +0000 (21:29 +0900)]
Handle Missing break in switch issue
Added break which was omitted
resolve: 1224463
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
hyeonseok lee [Tue, 6 Apr 2021 11:53:56 +0000 (20:53 +0900)]
Handle Uninitialized scalar field issue
Added default constructor to initialize scalar field
resolves: 1216569, 1216584
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
hyeonseok lee [Tue, 6 Apr 2021 11:52:14 +0000 (20:52 +0900)]
Handle Unchecked return value issue
Added if statement to check return value
resolve: 1216589
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
Jihoon Lee [Fri, 2 Apr 2021 08:17:56 +0000 (17:17 +0900)]
[Compiler] Alternate GraphRepresentation
This patch alternates graph representation and move interpreter to a new
file
v2.
Also change documentation setup
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Thu, 1 Apr 2021 10:36:08 +0000 (19:36 +0900)]
[Compiler] Add Graph Representation
This patch adds graph representation and it's interface
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Thu, 1 Apr 2021 10:32:20 +0000 (19:32 +0900)]
[Compiler] Declare interface
This patch declares interface of compiler / interpreter
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Thu, 1 Apr 2021 10:31:21 +0000 (19:31 +0900)]
[Compiler] Add concept of the compiler
This patch adds a concept of the compiler and class declaration.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Thu, 1 Apr 2021 08:05:58 +0000 (17:05 +0900)]
[Compiler/skeleton] Set up compiler source files
This patch setup compiler source files
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
jijoong.moon [Thu, 25 Mar 2021 07:39:47 +0000 (16:39 +0900)]
[ RNN ] Backwarding Implementation
This commit includes calculate gradient and derivatives of RNN Layer.
Resolves:
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
Jihoon Lee [Tue, 30 Mar 2021 06:48:49 +0000 (15:48 +0900)]
[Deps] Add iniparser dependency version
From SRI-D it was reported that iniparser 3.x is not compatible.
This patch adds a version check for the iniparser
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Parichay Kapoor [Mon, 29 Mar 2021 11:34:49 +0000 (20:34 +0900)]
[c-api] c-api depends only on cc-api
Update c-api implementation to only depend on cc-api
Also add some minor additional functions in the cc-api
to support the c-api functionality.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Mon, 29 Mar 2021 11:42:29 +0000 (20:42 +0900)]
[dataset] Update dataset cc-api
Update dataset cc-api to match with the c-api
Also remove extra redundant functionality
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Mon, 29 Mar 2021 10:18:45 +0000 (19:18 +0900)]
[model/API] Sync model cc API with c API
Sync the cc-API of model with the c-API
Some unnecessary functions have been removed.
Some others have been renamed.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 26 Mar 2021 06:33:50 +0000 (15:33 +0900)]
[layer] Update layer cpp API
Update layer cpp API to match the c-api interface.
Move pluggableLayer related stuff to layer_internal.
See Also #986
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 26 Mar 2021 05:04:50 +0000 (14:04 +0900)]
[graph] Remove graph edges after compile
This patch removes edges from the graph after compiling to
save the memory. This graph can be reconstructed by adding those edges
again from the information in the layers themselves.
See also #986
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 26 Mar 2021 04:54:23 +0000 (13:54 +0900)]
[graph] Update setting output layers in graph + bug fix
Update setting output layers in graph to a unified location.
The graph is first made with just input layers.
Output layers are set at the end for the completeness at
one go than adding at each realization to avoid more errors.
Also, added a bug fix where the last layer in the model
is not the last layer in the ini file. Now the last layer
is not the last layer in the adj but the layer without any
output_layers.
See also #986
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Tue, 30 Mar 2021 05:09:31 +0000 (14:09 +0900)]
[model/ini] Update ini loader for model
Update ini loader for model to support more properties
than the ones which are hardcoded.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Tue, 30 Mar 2021 02:06:04 +0000 (11:06 +0900)]
[ini] Add backward compatibility for optimizer
Added backward compatibility for optimizers.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 26 Mar 2021 05:41:39 +0000 (14:41 +0900)]
[unittest] Added unittest for train without optimizer
Added unittest for training without optimizer and some
corresponding fixes.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 19 Mar 2021 11:38:16 +0000 (20:38 +0900)]
[optimizer] Add optimizer section to INI
Add a new optimizer section to INI
This is essential to allow custom optimizers as the
properties of optimizers needs to be iterables.
Currently, optimizer needs to specified in the model, which
along being not the best design, limits the properties to
be set for the optimizer as the model loader has to know
which properties are for optimizer and which for model.
This patch separates the optimizer as a new section and updates
the unittests.
Note that this removes the default optimizer from adam. Now, it is
necessary for an optimizer to be defined in the model file, if to be used for training.
For inference, model can be defined without an optimizer.
Updated documentation for the changes made.
See also #986
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Jaeyun [Wed, 31 Mar 2021 06:11:32 +0000 (15:11 +0900)]
[Test/Util] use exit in script
'return' in script is not available, call 'exit' instead.
Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
jijoong.moon [Wed, 31 Mar 2021 11:33:52 +0000 (20:33 +0900)]
[ LSTM ] Add Skeleton LSTM Layer Class
This PR includes skeleton code of lstm layer
Resolves:
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
Jihoon Lee [Tue, 30 Mar 2021 05:48:40 +0000 (14:48 +0900)]
[Pooling2D] Change warning to error at init
For global_* pooling change warning to error for some parameter check
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Mon, 29 Mar 2021 08:41:53 +0000 (17:41 +0900)]
[Pooling2D] Rework global max pooling
**Changes proposed in this PR:**
- Rework global max pooling to work with lambda function
- Remove switch cases for the main loop in pooling
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Thu, 25 Mar 2021 13:14:44 +0000 (22:14 +0900)]
[Pooling2d] Rework Average Pooling
This patch refactors average pooling layer to not rely
on the pooling loop.
From this patch, max_idx is used to remember number of
effective elements used for the average calculation
Also add some checks on the `initailize`,
Also global average pooling is merged to average pooling
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Thu, 25 Mar 2021 11:08:24 +0000 (20:08 +0900)]
[Pooling2d] Rework pooling to avoid padding
This patch
1. set up scaffolding for the pooling to reuse some loop.
2. initialize index vector when setting batch (fixes a hidden
bug)
3. implements max pooling without additional memory allocation
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Mon, 29 Mar 2021 12:49:44 +0000 (21:49 +0900)]
[Pooling2D/Test] Add model tests
Add model test for various types of pooling2d
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
hyeonseok lee [Tue, 30 Mar 2021 04:51:54 +0000 (13:51 +0900)]
Handle BAD_OVERRIDE issue
Match type signatures with nntrainer::Optimizer by adding const
resolves: 458424, 458425
Self evaluation:
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
Jihoon Lee [Mon, 22 Mar 2021 06:53:00 +0000 (15:53 +0900)]
[rpm] Fix nnstreamer dependency
This patch resolves nnstreamer dependency problem. Thus making rpm to
enable plugin related test.
This patch is wating for nnstreamer/api#21
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Parichay Kapoor [Tue, 30 Mar 2021 02:35:44 +0000 (11:35 +0900)]
[graph] Bug fix for no loss
Added bug fix for handling the scenario when there is no loss
specified. The issue was the difference in ordering of the loss
types in the parser and loss type enums.
This patch fixes it. Further, graph now simply returns if no loss found.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
hyeonseok lee [Tue, 30 Mar 2021 03:48:16 +0000 (12:48 +0900)]
Handle Unchecked return value issue
Added return value of remove function
resolves: 1222078, 1223055
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
Parichay Kapoor [Tue, 30 Mar 2021 03:42:00 +0000 (12:42 +0900)]
[graph/ini] Support for default input_layers
This patch adds support for default input_layers
If no input_layers is specified, the layer above
the current layer in the ini file or the previously
adding layer in the model becomes the input layer for the current layer.
However, this connection is only made if the current layer
has no input layers.
Resolves #1046
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Jihoon Lee [Thu, 25 Mar 2021 04:17:16 +0000 (13:17 +0900)]
[Conv2d/Test] Add conv2d multistride test
This patch enables conv2d uneven multistride test where some part of
images are dropped
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Thu, 25 Mar 2021 04:15:19 +0000 (13:15 +0900)]
[Conv2d] Rework calcDerivative
**Changes proposed in this PR:**
- Rework conv2d::calcDerivative to enable calculating derivative when
some last strides are dropped.
- Disable channelmode im2col (commented because it is in the critical
path)
- Minor optimization on conv2d::forward
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Wed, 24 Mar 2021 07:19:48 +0000 (16:19 +0900)]
[Conv] Check conv2d restriction
This patch moves conv2d checks to the initialization.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
jijoong.moon [Wed, 24 Mar 2021 01:35:58 +0000 (10:35 +0900)]
[ RNN ] Set tanh as an default activation function
Set the tanh as an default activation function
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Wed, 24 Mar 2021 11:06:48 +0000 (20:06 +0900)]
[ RNN ] Fix Tensor copy bug and set proper initialization
This commit includes
. Fix Tensor copy. using getSharedDataTensor from hidden and input
. set proper hidden initialization depending on traning and inference
. Fix proper calculation of hidden
. Remove setActivation
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Mon, 22 Mar 2021 12:28:34 +0000 (21:28 +0900)]
[ RNN ] support various activation function
In this PR, various activation functions are supported using ActiFunc
Class.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Fri, 19 Mar 2021 08:34:34 +0000 (17:34 +0900)]
[ RNN ] Implementaion of forwarding
- Implementation of RNN forwarding.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Thu, 18 Mar 2021 03:54:37 +0000 (12:54 +0900)]
[ RNN ] Add initialization of RNN
Add Initialization of RNN Layer
- Set dimension and Weight
- Add Unittest for initialization
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
Parichay Kapoor [Thu, 18 Mar 2021 11:39:59 +0000 (20:39 +0900)]
[optimizer] Refactor optimizers
refactor optimizers to update to the new design. Now there are
two internal optimizer headers -
1. opitmizer_devel - which is used external of the optimizer. The
interface provided here must be sufficient to use the optimizer by
the models or other classes.
2. optimizer_impl - which also follows the same interface but provides
implementations for some more functions as well as some more member
variables.
optimizer.h in the API is a subset of the optimizer_devel which is the
exposed API for an external user to use.
optimizer_devel.h is the API which a user must implement when creating
their own optimizer.
optimizer_impl.h provides another class which a custom optimizer implementer
can extend for their ease.
These classes follow the below design
optimizer.h (ml::train::Optimizer) <- optimizer_devel.h (nntrainer::Optimizer)
<- optimizer_impl.h (nntrainer::OptimizerImpl)
Further, model, graph, and all other classes contains objects of type nntrainer::Optimizer
The c++ API is also reduced to match with the C API.
Once all the c++ APIs are matched with c API, then we can move more functions
from *_devel.h files to *.h files.
See also #986
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Thu, 18 Mar 2021 10:15:39 +0000 (19:15 +0900)]
[model-loader] Empty backbone now gives error
Added a check in model-loader where empty backbone now gives error.
For some reason, even the negative testcases for this scenario were made like
positive test cases. Updated them as well.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Wed, 17 Mar 2021 04:19:12 +0000 (13:19 +0900)]
[graph] Bug fix for name update
Bug fix for name updates when new layers are being
added in the graph. Earlier, the names were modified only
for the first entry but this can be a problem later.
Further this imposed restrictions on the order of the use of
updateNameInLayers() and addLayerNode().
Now, with this patch, the names are updated for all layers
except self. Further, the names are updated for all occurences
than just the first layer. This resolves both the issues mentioned
above.
Added some comments and checks for the ith variable before accesing it.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Tue, 16 Mar 2021 11:04:56 +0000 (20:04 +0900)]
[graph] Cleanup the graph
Cleanup redundant member variables from graph
Rename some of the functions. Some others to be modified
have been added as TODO.
getters have modified to work better.
Some redundant members have been removed from layer_internal as well.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Tue, 16 Mar 2021 10:11:06 +0000 (19:11 +0900)]
[graph] Add compiled status to graph
Add compiled status to graph
Compiling multiple times or modifying the graph after compilation
is erronous. Getting sorted list before completing the compilation
is also an error.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Tue, 16 Mar 2021 07:05:02 +0000 (16:05 +0900)]
[graph] Bug fixes in layer realizations
Add bug fixes for layer realizations for making the graph
Many scenarios were missed about creating connections for the graph
which this patch fixes.
Further, this patch reduce the isCompilable() checks as the first
layer cant be determined till the topologicalSort() of the graph is done.
Added checkCompiledGraph() where first layer and some more checks like
types are checked.
See Also #986
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Tue, 16 Mar 2021 05:16:05 +0000 (14:16 +0900)]
[graph] Move compile to graph
The compile has moved to graph and easier API exposed to model.
Also many public exposed functions reduced.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Tue, 16 Mar 2021 03:28:09 +0000 (12:28 +0900)]
[graph] Remove layers from graph
Update graph to remove layers and have a single data structure
for maintainence purposes. Now, adj represents the nodes list
which is unsorted. Sorted list of nodes is available after topological
sort in Sorted.
Additional Bug fixes:
- getSortedLayerNode was giving out wrong indices, its fixed now
- topological sort now empties sorted list before adding new elements
- other minor fixes to make adj replace layers
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
jijoong.moon [Mon, 22 Mar 2021 12:25:20 +0000 (21:25 +0900)]
[ ActFunc ] Separate Activation Function from Activation Layer
In order to use Activation function method in other Layer, it is
better to make sepearte the activation function definition and Layer.
In this PR, new ActiFunc Class is introduced and midified the
activation layer to use it.
RNN Layer also use this as an private variable.
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
hyeonseok lee [Tue, 23 Mar 2021 09:05:41 +0000 (18:05 +0900)]
[tensor_filter_nntrainer] Set custom deleter to unique_ptr
g_new() should match with g_malloc instread delete
Refer to https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html
It handles HEAP_INCOMPATIBLE.FREE issue
resolves: 458008, 458009
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
Jihoon Lee [Tue, 23 Mar 2021 05:35:56 +0000 (14:35 +0900)]
[TestHub] Produce xml output for gtest
As xml output is needed for the testhub, this patch add generation for
the meson test
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
hyeonseok lee [Mon, 22 Mar 2021 06:25:37 +0000 (15:25 +0900)]
Handle uncaught exception issue
Added try catch statement
resolves: 1143556, 1144840
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
hyeonseok lee [Mon, 22 Mar 2021 03:26:16 +0000 (12:26 +0900)]
Handle Large stack use(STACK_USE) issue
Coverity warns that in embedded application stack overflow may occur.
Because featureVector size(1080000) is bigger than maximum stack size(250000).
So define featureVector at the global area.
resolves: 1216560, 1216582
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
hyeonseok lee [Mon, 22 Mar 2021 03:17:35 +0000 (12:17 +0900)]
Handle Not restoring ostream format(STREAM_FORMAT_STATE) issue
Restore outputstream adjustflag to standard stream
resolve: 1222083
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
hyeonseok lee [Mon, 22 Mar 2021 01:50:13 +0000 (10:50 +0900)]
Handle Uninitialized scalar field(UNINIT_CTOR) issue
Set member variable buffer_size, buffer_axis in constructor
resolve: 1216586
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
hyeonseok lee [Fri, 19 Mar 2021 06:56:28 +0000 (15:56 +0900)]
Handle Unchecked return value(CHECKED_RETURN) issues
Added check the return value
resolves: 1222078, 1222441
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
hyeonseok lee [Fri, 19 Mar 2021 05:54:28 +0000 (14:54 +0900)]
Handle Unused value issue
Store status value using originStatus to protect from overwriting
resolves: 1216574, 1216576, 1216588, 1216594
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
jijoong.moon [Thu, 11 Mar 2021 11:46:06 +0000 (20:46 +0900)]
[ Application ] Add Embedding Layer Training Example
This PR includes,
- Simple Logistic Regression Application to train Embedding Layer + Flatten +
Fullyconnected Layer.
- Generate Input + Keras Code
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
Parichay Kapoor [Fri, 19 Mar 2021 09:16:58 +0000 (18:16 +0900)]
[models/test] Valgrind models test fix
Valgrind gives the error of uninitialized memory usage for this
unittest which is fixed with this patch.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 19 Mar 2021 08:44:55 +0000 (17:44 +0900)]
[test/bug] Bug fix for layers unittest
This patch adds bug fix for layers unittest
resetLayer() used to first free the layer and then call reset on the manager.
Freeing the layer used to free the memory of the weights, which left
the reference_wrapper for the weights in the manager in an undefined state.
This patch changes the order. Further, this patch removes some unsafe
practices from the var_grad.
This is a hotfix. The inability to check the validity of the weights in the manager
will be handled separately.
Resolves #1027
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Jihoon Lee [Tue, 16 Mar 2021 08:50:43 +0000 (17:50 +0900)]
[Test] Add pluggable layer test
Add some missing test for the pluggable layer
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Tue, 16 Mar 2021 07:58:01 +0000 (16:58 +0900)]
[Package] Use meson test
As meson already provides test suite, this patch substitue old test to
meson test. This is to provide coherency between build test and simple
test conducted on a local machine.
resolves #998
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Tue, 16 Mar 2021 07:40:08 +0000 (16:40 +0900)]
[Bug] s/weight_decay/weight_regularizer
weight_decay is a old property which made some app test to fail. This
patch resolves the issue
revealed from #1008
resolves #1018
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Parichay Kapoor [Wed, 10 Mar 2021 14:03:56 +0000 (23:03 +0900)]
[Weights] Split weight variable init and alloc
Split the initialization and memory allocation for weights
3 exposed bugs with this has been resolved:
- manager does not allow tracking var_grads once initialized
- resetGradient confirms the allocation is done before accessing the memory
- allocateVariable() calls the correct initializer now
Further, the logic of reinitialize in unittest for layers has been
split into two parts - initialize and reinitialize where
reinitialize will reset layer and manager and then call initialize.
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Wed, 10 Mar 2021 13:19:29 +0000 (22:19 +0900)]
[layers] Weight creation bug fix
The name of the weight being passed as string was being interpreted as a string
for the variable alloc_now. This patch fixes it by passing the arguments
appropriately.
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
jijoong.moon [Wed, 17 Mar 2021 04:46:47 +0000 (13:46 +0900)]
[ RNN ] Add Skeleton Code for RNNLayer
This PR includes,
skeleton of RNN Layer
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Thu, 11 Mar 2021 11:40:12 +0000 (20:40 +0900)]
[ UNITTEST ] Add More Embedding Layer Unit Test
This PR includes,
. Unit test cases of Embedding Layer inference & backwarding
. Add Input Generation for Embedding Layer
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
jijoong.moon [Tue, 9 Mar 2021 04:40:33 +0000 (13:40 +0900)]
[ LAYER ] Add backwarding of Embedding Layer
This PR includes
- Backwarding implementaiton of Embedding Layer
- Add Test Cases ( More Test Cases will be added )
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
Jihoon Lee [Fri, 12 Mar 2021 12:53:40 +0000 (21:53 +0900)]
[Filter] Refactor filter to be more robust
**Changes Proposed in this PR aim for**
1. nntrainer filter no longer requires dimensions specified
1. nntrainer filter now adapts to the incoming batchsize(required exposing
neuralnet::setBatchSize)
1. nntrainer filter now do not copy incoming input to inference from the
filter side
1. nntrainer filter adapts to the multiple input, multiple output
**Major Changes**
`getInputDim`, `getOutTensorDim` is replaced to `setInputDim`
nntrainer->run now recognizes more than 1 input, 1 output
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Wed, 10 Mar 2021 02:15:39 +0000 (11:15 +0900)]
[Chores] s/nnstreamer-filter/nnstreamer
To match the directory name, moved test/nnstreamer-filter to nnstreamer
+ minor reformatting on a meson.build
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Parichay Kapoor [Tue, 16 Mar 2021 09:39:56 +0000 (18:39 +0900)]
[docs] Minor indentation fix
Minor indentation fix
Report from https://github.com/nnstreamer/nntrainer/pull/993#discussion_r594884810
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
hyeonseok lee [Tue, 16 Mar 2021 08:59:18 +0000 (17:59 +0900)]
Add Unittest for util_func
Unittest for following functions
rotate_180
readString
writeString
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
Parichay Kapoor [Fri, 12 Mar 2021 13:09:11 +0000 (22:09 +0900)]
[all] remove friends
Remove friendship between classes as it makes extending the interface
difficult. Some friendships exist which will be removed in upcoming
PRs.
See Also #986
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Jihoon Lee [Mon, 15 Mar 2021 12:03:14 +0000 (21:03 +0900)]
[AppContext] Remove throw regular path
There was a throw in a regular call path. This patch removes the error
by changing semantics.
@kparichay thank you for the report.
resolves #1012
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Jihoon Lee [Fri, 12 Mar 2021 11:09:41 +0000 (20:09 +0900)]
[loader] Change semantics of path in ini
Ini description is expected to be somewhat determinisitic.
But paths inside ini is not deterministic. For example, if you have
save_path=model.bin,
if A application trains it and B application try to use it, reading the
same ini does not gaurantee B to read to the weights from A.
It is because A and B can have diffrent working path.
To make it consistent, this patch changes semantics of paths' in ini.
1. if model.appcontext.hasWorkingDirectory(), path inside ini are interpreted from
the workingDirectory
2. else, it is interpreted **relative to where ini is located at.**
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Parichay Kapoor [Mon, 15 Mar 2021 06:59:18 +0000 (15:59 +0900)]
[graph] bug fix on layer names
Major bug fix on layer names. Layer names were being checked for duplicacy
but not added in the names list. This patch solves that bug.
Also added bug fixes to backbone being added to the graph properly
with appropriate name checkings now.
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 12 Mar 2021 13:09:11 +0000 (22:09 +0900)]
[all] remove friends
Remove friendship between classes as it makes extending the interface
difficult. Some friendships exist which will be removed in upcoming
PRs.
See Also #986
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 12 Mar 2021 13:01:27 +0000 (22:01 +0900)]
[model] Move layers from model to graph
Move layers from model to graph.
This places all the graph related elements in the graph
and easy to extend and reason about model.
This shows the redundancy in the graph which shall be handled in
upcoming PRs.
See Also #986
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Jihoon Lee [Tue, 16 Mar 2021 01:29:13 +0000 (10:29 +0900)]
[SE] Make coverage build runnable
This patch is a workaround to make coverage build runnable for now.
There will be following patches to enable the commented lines.
See also #997
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Parichay Kapoor [Tue, 9 Mar 2021 10:15:16 +0000 (19:15 +0900)]
[docs] Added documentation for memory management
Added documentation for memory management.
Resolves #945
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Fri, 12 Mar 2021 12:45:45 +0000 (21:45 +0900)]
[model] Read and save after init
Add a check in model to read and save after init only
Added a corresponding unittest for the negative case
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Jihoon Lee [Fri, 12 Mar 2021 07:45:26 +0000 (16:45 +0900)]
[Clean] Delete overlapping profiler
Delete overlapping profiler got into from merge order
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Parichay Kapoor [Thu, 11 Mar 2021 13:54:44 +0000 (22:54 +0900)]
[layer/unittest] Delete old unittest
Delete negative unittest of loss layer which tests the failure of forward
without label. However, forward label is now a valid operation for loss layer.
The current reason why this unittest fails is because the number of inputs
are not managed correctly and it fails. This is managed with the previous
PR to ensure that number of inputs and outputs remain correct.
However, now it segfaults because the layer has not been initialized, and
its inputs and output havenot been assigned.
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Thu, 11 Mar 2021 11:50:14 +0000 (20:50 +0900)]
[layer] refactor num of inputs/outputs
Refactor layer to properly handle the number of inputs
and outputs, which is maintained across the in/out dimensions,
in/out data.
This is not maintained for in/out layers as these properties will move
out of layers in the next commit.
Also added bugfix in output_layer which used to clear the output dimension
rendering the num outputs 0 for sometime.
NetworkGraph setNumNetBufferSize is also removed as the above
refactoring handles it at the layer level.
See Also #986
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
hyeonseok lee [Wed, 10 Mar 2021 05:40:13 +0000 (14:40 +0900)]
Handle NO_CATCH issue
Added missing try-catch statement
resolve 457589
Signed-off-by: hyeonseok lee <hs89.lee@samsung.com>
Jihoon Lee [Wed, 10 Mar 2021 02:31:42 +0000 (11:31 +0900)]
[Meson/Clean] remove duplicating deps
**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
Parichay Kapoor [Tue, 9 Mar 2021 13:00:26 +0000 (22:00 +0900)]
[model] Update batch size check
Update batch size check to exactly match with the model
This is because batch size is used by certain layers for calculation and
running an input with wrong batch (with correct memory allocations) can result
in wrong output.
This is independent of the running a batch size 16 with memory allocated for
bigger batch size. That will still work with this patch as long as batch size
is set correctly for the model, and memory allocated is at least big enough
to handle this batch size.
See also #888
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
Parichay Kapoor [Tue, 9 Mar 2021 12:18:30 +0000 (21:18 +0900)]
[app] Set env to run the app test
Set environment variable in meson to run the application test
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>