Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DeepGrail Linker
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
PNRIA
Global Helper
DeepGrail Linker
Commits
92f65c05
Commit
92f65c05
authored
3 years ago
by
Caroline DE POURTALES
Browse files
Options
Downloads
Patches
Plain Diff
correction on positional enco
parent
5bb83ca8
No related branches found
No related tags found
2 merge requests
!6
Linker with transformer
,
!5
Linker with transformer
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Configuration/config.ini
+0
-1
0 additions, 1 deletion
Configuration/config.ini
Linker/PositionEncoding.py
+3
-3
3 additions, 3 deletions
Linker/PositionEncoding.py
with
3 additions
and
4 deletions
Configuration/config.ini
+
0
−
1
View file @
92f65c05
...
...
@@ -3,7 +3,6 @@ transformers = 4.16.2
[DATASET_PARAMS]
symbols_vocab_size
=
26
atom_vocab_size
=
17
max_len_sentence
=
266
max_atoms_in_sentence
=
1250
max_atoms_in_one_type
=
510
...
...
This diff is collapsed.
Click to expand it.
Linker/PositionEncoding.py
+
3
−
3
View file @
92f65c05
...
...
@@ -11,9 +11,9 @@ class PositionalEncoding(nn.Module):
position
=
torch
.
arange
(
max_len
).
unsqueeze
(
1
)
div_term
=
torch
.
exp
(
torch
.
arange
(
0
,
d_model
,
2
)
*
(
-
math
.
log
(
10000.0
)
/
d_model
))
pe
=
torch
.
zeros
(
max_len
,
1
,
d_model
)
pe
[
:
,
0
,
0
::
2
]
=
torch
.
sin
(
position
*
div_term
)
pe
[
:
,
0
,
1
::
2
]
=
torch
.
cos
(
position
*
div_term
)
pe
=
torch
.
zeros
(
1
,
max_len
,
d_model
)
pe
[
0
,
:
,
0
::
2
]
=
torch
.
sin
(
position
*
div_term
)
pe
[
0
,
:
,
1
::
2
]
=
torch
.
cos
(
position
*
div_term
)
self
.
register_buffer
(
'
pe
'
,
pe
)
def
forward
(
self
,
x
):
...
...
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