I want to implement a multi task learning framework in tensorflow. I'm currently implementing something like this (pseudo code)
define_reg_cost()
define_clas_cost()
reg_optimizer.(reg_learning_rate).min(reg_cost)
clas_optimizer.(clas_learning_rate).min(clas_cost)
for num_iterations:
reg_optimizer.run()
clas_optimizer.run()
This dosen't seem the right approach to me. I have two loss functions and I want to learn the weights to minimize both losses with different learning rates in the same optimizer. I basically want the gradient optimizer to do updates like this:
weight_updated = weight - learning_rate_1 * d(loss1)/dw - learning_rate_2 * d(loss2)/dw
Any tips on how to do this (possibly using optimizer.apply_gradients())?