clab / clab/dynet

How to find indices with zero values?

Open
#1,469 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
3.4k
Forks
701
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have a vector Expression of dimension (ds, 1). Is there any way to find the indices having zero values in this Expression, or to check if a value in it is equal to zero? The first would be most preferable. What if the expression is batched?

Using cg.forward() followed by as_vector and comparing after that for zeros would slow down computation during training in my opinion.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the DyNet Expression API and the cg.forward() and as_vector() paths mentioned in the issue, including how batched expressions are represented. Determine whether zero-value indices or equality checks are currently supported and define the expected behavior for batched expressions before estimating an implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.