Comments (6)
backward is the step to compute gradient so it's supposed to be the most expensive step.
The backward is not associated with the dataset, but associated with the size of input.
You can try to break the dataset into subsets and call the fit
function multiple times as suggested in README.md
.
from uis-rnn.
backward is the step to compute gradient so it's supposed to be the most expensive step.
The backward is not associated with the dataset, but associated with the size of input.
You can try to break the dataset into subsets and call the
fit
function multiple times as suggested inREADME.md
.
Sir,
I break the dataset into 2 subsets, each subsets include 41000 elements which Smaller than the test train_sequence you provided (47350).But it still cost 8 seconds in each iteration, and with the data you provide, it took less than a second.
from uis-rnn.
Is 41000 the number of time steps, or the feature dimension? If former, what is your feature dimension?
Also, did you normalize the features before you feed them into uisrnn? If not, what's the range of your features?
from uis-rnn.
Is 41000 the number of time steps, or the feature dimension? If former, what is your feature dimension?
Also, did you normalize the features before you feed them into uisrnn? If not, what's the range of your features?
41000 is the feature dimension of a 2-dim numpy array (41000, 256), like your feature dimension(47350, 256). The normalize you mentioned is "The embedding vector (d-vector) is defined as the L2 normalization of the network output"? I extracted d-vector by "PyTorch_Speaker_Verification". I think the normalize is done.
from uis-rnn.
You will need to discuss this with the author of PyTorch_Speaker_Verification.
We are not responsible for the correctness or any issue of third-party libraries.
from uis-rnn.
@hcfeng201
you should change the embedding create dome:
for file in os.listdir(folder):
if file[-4:] == '.wav':
# subprocess.call(['ffmpeg', '-i', 'file', file[-4:]+'.wav'])
print(folder + '/' + file)
times, segs = VAD_chunk(2, folder + '/' + file)
print("times" * 10, times)
print("segs" * 10)
if segs == []:
print('No voice activity detected')
continue
concat_seg = concat_segs(times, segs)
STFT_frames = get_STFTs(concat_seg)
STFT_frames = np.stack(STFT_frames, axis=2)
STFT_frames = torch.tensor(np.transpose(STFT_frames, axes=(2, 1, 0)))
embeddings = embedder_net(STFT_frames)
# print(embeddings)
aligned_embeddings = align_embeddings(embeddings.detach().numpy())
train_sequence.append(aligned_embeddings)
for embedding in aligned_embeddings:
train_cluster_id.append(str(label))
label += 1
test_sequence = np.concatenate(train_sequence, axis=0)
test_cluster_id = np.asarray(train_cluster_id)
np.save('test_sequence', test_sequence)
np.save('test_cluster_id', test_cluster_id)
print("%" * 100)
print(test_sequence.shape, type(test_sequence))
and change uis-rnn test demo:
test_sequence = np.load('./data/test_sequence.npy')
test_cluster_id = np.load('./data/test_cluster_id.npy')
model = uisrnn.UISRNN(model_args)
model.load(SAVED_MODEL_NAME)
#testing
print("%" * 100)
print(test_sequence.shape, type(test_sequence))
print(test_cluster_id, type(test_cluster_id))
#for (test_sequence, test_cluster_id) in zip(test_sequences, test_cluster_ids):
predicted_label = model.predict(test_sequence, inference_args)
predicted_labels.append(predicted_label)
accuracy = uisrnn.compute_sequence_match_accuracy(list(test_cluster_id), predicted_label)
test_record.append((accuracy, len(test_cluster_id)))
print('Ground truth labels:')
print(test_cluster_id)
print('Predicted labels:')
print(predicted_label)
print('-' * 80)
output_string = uisrnn.output_result(model_args, training_args, test_record)
print('Finished diarization experiment')
print(output_string)
from uis-rnn.
Related Issues (20)
- Embedding Extraction Procedure HOT 1
- about model HOT 1
- [Bug] Predict method does not finish HOT 3
- what is train data format? HOT 1
- Question about custom data generator
- uis-rnn gives different result on broken audios and continuous audios HOT 5
- how to control the number of different speaker when predicting? HOT 1
- Unable to convert pytorch model to tensorflow in Diarization on mobile device. HOT 2
- [Question] Are input d-vectors for training assumed L2-normalized? HOT 8
- Change input size HOT 1
- No module named coverage HOT 1
- Is is possible to pre-load the model for multiple request? HOT 1
- [Question] About num_non_zero HOT 1
- [Question] The dimension of toy test data [test_sequence] is (25, 95, 256) what does the first 2 dimension represent? Toy train data [train_sequence] has dimension (4627, 256) which is understandable. HOT 1
- Is there a way to fine tune an already existing pre-trained model? HOT 1
- rnn initial state trainable HOT 1
- Any documentations on training from scratch using custom data in other languages ? HOT 1
- [Bug] Making a prediction on CPU after training on GPU
- Predicted labels doesn't match with Ground truth labels but the accuracy of test results is 0.8% HOT 1
- assign gpu with arguments
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uis-rnn.