-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hello thanks for sharing your code!
I wanted to clarify the correctness of pdac recursive implementation as currently i receive segments that are > max_segment_length.
Mostly I think the issues are in lines: #L121-L123 and #L134-L135 in the implementation that should be deleted.
def recusrive_split(sgm):
if sgm.duration < max_segment_length:
segments.append(sgm)
else:
j = 0
sorted_indices = np.argsort(sgm.probs)
while j < len(sorted_indices):
split_idx = sorted_indices[j]
split_prob = sgm.probs[split_idx]
### this line could allow for sgm.duration > max_seglength
> if split_prob > threshold:
> segments.append(sgm)
> break
sgm_a, sgm_b = split_and_trim(sgm, split_idx, threshold)
if (
sgm_a.duration > min_segment_length
and sgm_b.duration > min_segment_length
):
recusrive_split(sgm_a)
recusrive_split(sgm_b)
break
j += 1
### this line could allow for sgm.duration > max_seglength
> else:
> segments.append(sgm)Could you please explain the need for those two clauses? , from empirical experiment and by matching with the algorithm in the paper they are not needed.
Metadata
Metadata
Assignees
Labels
No labels
