Commit ba4b91f1 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

fix bug in pavx

parent 188f6ba4
......@@ -31,8 +31,9 @@ This is the 'detplot' module
This file is a translation of the BOSARIS toolkit.
For more information, refers to the license provided with this package.
"""
import numpy
import copy
import matplotlib
import numpy
import os
if "DISPLAY" not in os.environ:
......@@ -309,8 +310,8 @@ def pavx(y):
assert y.shape[0] > 0, 'Input array is empty'
n = y.shape[0]
index = numpy.zeros(n)
length = numpy.zeros(n)
index = numpy.zeros(n, dtype=int)
length = numpy.zeros(n, dtype=int)
# An interval of indices is represented by its left endpoint
# ("index") and its length "length"
......@@ -326,7 +327,7 @@ def pavx(y):
for j in range(1, n):
# a new index interval, {j}, is created:
ci += 1
index[ci] = j
index[ci] = j + 1
length[ci] = 1
ghat[ci] = y[j]
while (ci >= 1) & (ghat[numpy.max(ci - 1, 0)] >= ghat[ci]):
......@@ -336,13 +337,13 @@ def pavx(y):
length[ci - 1] = nw
ci -= 1
height = ghat[:ci + 1]
width = length[:ci + 1]
height = copy.deepcopy(ghat[:ci + 1])
width = copy.deepcopy(length[:ci + 1])
# Now define ghat for all indices:
while n >= 0:
for j in range(int(index[ci]), int(n)):
ghat[j] = ghat[ci]
for j in range(int(index[ci]), int(n + 1)):
ghat[j - 1] = ghat[ci]
n = index[ci] - 1
ci -= 1
......
......@@ -8,8 +8,6 @@ import torch.nn as nn
from torch import optim
from torch.utils.data import Dataset
from sidekit.frontend.io import _read_dataset_percentile
from sidekit.frontend.io import read_hdf5_segment
from sidekit.frontend.io import _read_dataset_percentile
import logging
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment