Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
word2vec
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
35
Issues
35
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DESHPANDE SRIJAY PARAG
word2vec
Commits
d83ccfba
Commit
d83ccfba
authored
Jan 30, 2015
by
tmikolov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix in InitUnigramTable() - some words could not have been sampled as negative examples
parent
330c98d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
word2vec.c
word2vec.c
+5
-5
No files found.
word2vec.c
View file @
d83ccfba
...
...
@@ -51,17 +51,17 @@ int *table;
void
InitUnigramTable
()
{
int
a
,
i
;
long
long
train_words_pow
=
0
;
real
d1
,
power
=
0
.
75
;
double
train_words_pow
=
0
;
double
d1
,
power
=
0
.
75
;
table
=
(
int
*
)
malloc
(
table_size
*
sizeof
(
int
));
for
(
a
=
0
;
a
<
vocab_size
;
a
++
)
train_words_pow
+=
pow
(
vocab
[
a
].
cn
,
power
);
i
=
0
;
d1
=
pow
(
vocab
[
i
].
cn
,
power
)
/
(
real
)
train_words_pow
;
d1
=
pow
(
vocab
[
i
].
cn
,
power
)
/
train_words_pow
;
for
(
a
=
0
;
a
<
table_size
;
a
++
)
{
table
[
a
]
=
i
;
if
(
a
/
(
real
)
table_size
>
d1
)
{
if
(
a
/
(
double
)
table_size
>
d1
)
{
i
++
;
d1
+=
pow
(
vocab
[
i
].
cn
,
power
)
/
(
real
)
train_words_pow
;
d1
+=
pow
(
vocab
[
i
].
cn
,
power
)
/
train_words_pow
;
}
if
(
i
>=
vocab_size
)
i
=
vocab_size
-
1
;
}
...
...
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