Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Franck Dary
macaon
Commits
311b2010
Commit
311b2010
authored
2 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Removed dimension reduction for NumericColumn module
parent
e4ea7fb9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
torch_modules/src/Concat.cpp
+8
-3
8 additions, 3 deletions
torch_modules/src/Concat.cpp
torch_modules/src/NumericColumnModule.cpp
+1
-1
1 addition, 1 deletion
torch_modules/src/NumericColumnModule.cpp
with
9 additions
and
4 deletions
torch_modules/src/Concat.cpp
+
8
−
3
View file @
311b2010
...
...
@@ -2,16 +2,21 @@
ConcatImpl
::
ConcatImpl
(
int
inputSize
,
int
outputSize
)
:
inputSize
(
inputSize
),
outputSize
(
outputSize
)
{
dimReduce
=
register_module
(
"dimReduce"
,
torch
::
nn
::
Linear
(
inputSize
,
outputSize
));
if
(
inputSize
and
outputSize
)
// if one of these is null, don't use a linear layer
dimReduce
=
register_module
(
"dimReduce"
,
torch
::
nn
::
Linear
(
inputSize
,
outputSize
));
}
torch
::
Tensor
ConcatImpl
::
forward
(
torch
::
Tensor
input
)
{
return
dimReduce
(
input
).
view
({
input
.
size
(
0
),
-
1
});
if
(
dimReduce
)
return
dimReduce
(
input
).
view
({
input
.
size
(
0
),
-
1
});
return
input
.
view
({
input
.
size
(
0
),
-
1
});
}
int
ConcatImpl
::
getOutputSize
(
int
sequenceLength
)
{
return
sequenceLength
*
outputSize
;
if
(
outputSize
)
return
sequenceLength
*
outputSize
;
return
sequenceLength
;
}
This diff is collapsed.
Click to expand it.
torch_modules/src/NumericColumnModule.cpp
+
1
−
1
View file @
311b2010
...
...
@@ -35,7 +35,7 @@ NumericColumnModuleImpl::NumericColumnModuleImpl(std::string name, const std::st
else
if
(
subModuleType
==
"GRU"
)
myModule
=
register_module
(
"myModule"
,
GRU
(
1
,
outSize
,
options
));
else
if
(
subModuleType
==
"Concat"
)
myModule
=
register_module
(
"myModule"
,
Concat
(
1
,
1
));
myModule
=
register_module
(
"myModule"
,
Concat
(
0
,
0
));
else
util
::
myThrow
(
fmt
::
format
(
"unknown sumodule type '{}'"
,
subModuleType
));
}
catch
(
std
::
exception
&
e
)
{
util
::
myThrow
(
fmt
::
format
(
"{} in '{}'"
,
e
.
what
(),
definition
));}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment