HomePhabricator

loss_function_batch works for now, but only receives one candidate. Have to…

Description

loss_function_batch works for now, but only receives one candidate. Have to figure out how to pass the whole batch.

Signed-off-by: Andre Klein <andre.klein@dkfz-heidelberg.de>

Details

Provenance
kleinaAuthored on May 13 2020, 11:32 AM
Parents
rOBSHYPPOPY24436615c9c6: Fixed typo.
Branches
Unknown
Tags
Unknown

Event Timeline

floca added inline comments.
/hyppopy/solvers/OptunitySolver.py
89–96

Why using map?

Why not just

candidates = {}
for elem in seq:
  can = CandidateDescriptor(**elem)
  candidates[can.ID] = can

return f(candidates)

and in your OptionitySolver::loss_function_batch

def loss_function_batch(self, **candidates):
  result = super(OptunitySolver, self).loss_function_batch([candidates[k] for k in candidates])
  return [ values['loss'] for values in result]

?