GithubHelp home page GithubHelp logo

Comments (11)

hongyuntw avatar hongyuntw commented on May 18, 2024 1

@FurkanGozukara
I just change the loader in solver.py

i think we need to load two data at same time
so maybe add
x_real_trg, emb_trg, f0_trg, len_trg = next(data_iter)
after line 142,145

now we have two data in one iteration
and i just use the preprocess in demo.ipynb
try to make same shape with this code below
f0_pred = P(uttr_org_pad, f0_trg_onehot)[0]

and use same loss as G

it work but i dont know is it correct or not

from speechsplit.

hongyuntw avatar hongyuntw commented on May 18, 2024 1

@FurkanGozukara
due to some reason i cant copy my whole code to you
All change in solver.py class Solver
but

  1. you need to create F0converter in build_model function
self.P = F0_Converter(self.hparams)
self.p_optimizer = torch.optim.Adam(self.P.parameters(), self.p_lr, [self.beta1, self.beta2], weight_decat = 0.000001)(or whatever you want)
  1. in reset_grad function you need to add
self.p_optimizer.zero_grad()
  1. in training loop (inside train function) fix the code be like
try:
    x_real_org,emb_org,f0_org,len_org = next(data_iter)
    x_real_trg,emb_trg,f0_trg,len_trg = next(data_iter)
except:
    data_iter = iter(data_loader)
    x_real_org,emb_org,f0_org,len_org = next(data_iter)
    x_real_trg,emb_trg,f0_trg,len_trg = next(data_iter)
  1. preprocess f0_trg based on demo.ipynb (inside train function)
    here's my code
f0_list = []
for i in range(f0_trg.shape[0]):
    log_f0 = f0_trg[i].cpu().numpy()
    flatten_log_f0 = log_f0.flatten()
    f0_trg_quantized = quantize_f0_numpy(flatten_log_f0)[0]
    f0_trg_onehot  = torch.from_numpy(f0_trg_quantized).to(self.device)
    f0_list.append(f0_trg_onehot)
f0_trg = torch.stack(f0_list)
  1. P forward (inside train function)
f0_pred = self.P(x_real_org,f0_trg)
p_loss_id = F.mse_loss(f0_pred,f0_trg,reduction='mean')
  1. add backward code (inside train function)

from speechsplit.

auspicious3000 avatar auspicious3000 commented on May 18, 2024

The training code for P is almost identical to solver.py. You can get it by modifying solver.py based on the description in the paper.

from speechsplit.

steven850 avatar steven850 commented on May 18, 2024

train.py or main.py? I only see main.py

from speechsplit.

niu0717 avatar niu0717 commented on May 18, 2024

train.py or main.py? I only see main.py

solver.py

from speechsplit.

hongyuntw avatar hongyuntw commented on May 18, 2024

I still have no idea how to train f0 converter ...
only need change code in solver.py...?

from speechsplit.

FurkanGozukara avatar FurkanGozukara commented on May 18, 2024

@shubham-IISc @hongyuntw any idea how to solve this problem? Any help appreciated

#28

from speechsplit.

FurkanGozukara avatar FurkanGozukara commented on May 18, 2024

@hongyuntw thank you for answer but i didn't understand what you mean

could you show as whole code?

from speechsplit.

FurkanGozukara avatar FurkanGozukara commented on May 18, 2024

@hongyuntw thank you for answer

could you edit your answer and write top of them the class or method names where should I put them?

could you change this to a full example "self.p_optimizer = xxxx(whatever you want)"

from speechsplit.

hongyuntw avatar hongyuntw commented on May 18, 2024

@FurkanGozukara
ok done, hope this helps

from speechsplit.

FurkanGozukara avatar FurkanGozukara commented on May 18, 2024

@hongyuntw thank you very much for answer

I am getting error name 'F0_Converter' is not defined

Also what does "add backward code (inside train function)" means?

Here I have uploaded everything to a repository = https://github.com/FurkanGozukara/SpeechSplitTest

image

from speechsplit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.