what can I write in this code :
def initialize_fn():
...
The state object returned by iterative_process.initialize() is typically a Python container (tuple, collections.OrderedDict, etc) that contains numpy arrays. To see this, try print(state) after initialize.
Perhaps simply replacing the values with the those loaded from an external file after initialze() and before loop over next():
def load_my_weights(filename):
# read from external file, create numpy arrays
iterative_process = IterativeProcess(initialize_fn, next_fn)
state = iterative_process.initialize()
state['model'] = load_my_weights(filename) # assumes 'model' is a key in state.
for round in range(num_rounds):
state = iterative_process.next(state)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With