Send Moses-support mailing list submissions to
moses-support@mit.edu
To subscribe or unsubscribe via the World Wide Web, visit
http://mailman.mit.edu/mailman/listinfo/moses-support
or, via email, send a message with subject or body 'help' to
moses-support-request@mit.edu
You can reach the person managing the list at
moses-support-owner@mit.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Moses-support digest..."
Today's Topics:
1. Re: Questions about kbmira code in Moses (Barry Haddow)
----------------------------------------------------------------------
Message: 1
Date: Fri, 06 Mar 2015 16:35:53 +0000
From: Barry Haddow <bhaddow@staffmail.ed.ac.uk>
Subject: Re: [Moses-support] Questions about kbmira code in Moses
To: Liangyou Li <llysuda@gmail.com>, moses-support@mit.edu
Message-ID: <54F9D769.8000908@staffmail.ed.ac.uk>
Content-Type: text/plain; charset=UTF-8; format=flowed
Hi Liangyou
This doesn't look right. In fact there is no reason for the gap between
the indices. Let me look into it,
cheers - Barry
On 06/03/15 15:43, Liangyou Li wrote:
> I have a question about the function :
> MiraWeightVector.ToSparse(SparseVector* sparse) .
>
> It's defined as this:
>
> void MiraWeightVector::ToSparse(SparseVector* sparse) const
> {
> for (size_t i = 0; i < m_weights.size(); ++i) {
> if(abs(m_weights[i])>1e-8) {
> sparse->set(i,m_weights[i]);
> }
> }
> }
>
> This means the same index i is used for both SparseVector and
> MiraWeightVector.
> However, according to the code in kbmira.cpp, there's a gap between
> the indexes.
>
> for dense feature: size_t id = SparseVector::encode(names[i]);
> then, for sparse feature: size_t id = SparseVector::encode(name)
> + initDenseSize;
>
>
> ?Why isn't the ToSparse function looks like this:
>
> void MiraWeightVector::ToSparse(SparseVector* sparse, size_t
> denseSize) const
> {
> for (size_t i = 0; i < m_weights.size(); ++i) {
> if (i < denseSize) {
> sparse->set(i,m_weights[i]);
> } else {
> if(abs(m_weights[i])>1e-8) {
> sparse->set(i-denseSize,m_weights[i]);
> }
> }
> }
> }
>
> I'm kind of confused, did I miss something ?
> Many thanks.
>
> Liangyou
>
> --
>
> Liangyou Li
> CNGL
> School of Computing
> Dublin City University
>
>
>
> _______________________________________________
> Moses-support mailing list
> Moses-support@mit.edu
> http://mailman.mit.edu/mailman/listinfo/moses-support
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
------------------------------
_______________________________________________
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support
End of Moses-support Digest, Vol 101, Issue 23
**********************************************
Subscribe to:
Post Comments (Atom)
0 Response to "Moses-support Digest, Vol 101, Issue 23"
Post a Comment