Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
asv-ml
mlmc
Commits
e3b47e1c
Commit
e3b47e1c
authored
Oct 18, 2021
by
Janos Borst
Browse files
maybe change score output
parent
518b402a
Pipeline
#50006
passed with stage
in 10 minutes and 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mlmc/models/zeroshot/embedding/embedding_weighted.py
View file @
e3b47e1c
...
...
@@ -67,7 +67,7 @@ class EmbeddingBasedWeighted(SentenceTextClassificationAbstract, TextClassificat
if
"max"
in
self
.
mode
:
word_maxs
=
word_scores
.
reshape
((
input_embedding
.
shape
[
0
],
label_embedding
.
shape
[
0
],
-
1
)).
max
(
-
1
)[
0
]
r
=
r
*
word_maxs
return
r
return
torch
.
log
(
0.5
*
(
r
+
1
))
def
embed
(
self
,
x
):
"""
...
...
@@ -125,6 +125,6 @@ class EmbeddingBasedWeighted(SentenceTextClassificationAbstract, TextClassificat
x
=
self
.
transform
(
x
)
with
torch
.
no_grad
():
output
=
self
.
act
(
self
(
x
))
output
=
0.5
*
(
output
+
1
)
#
output = 0.5*(output+1)
self
.
train
()
return
output
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment