#NEWLINE# def __init__( self , sc , master_network , optimizer = None , mode = 'asynchronous' , frequency = 'epoch' , num_workers = 4 , * args , **kwargs ) : #NEWLINE# #INDENT# self . spark_context = sc #NEWLINE# self . _master_network = master_network #NEWLINE# if ( optimizer is None ) : #NEWLINE# #INDENT# self . optimizer = default_optimizer ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . optimizer = optimizer #NEWLINE# #UNINDENT# self . mode = args #NEWLINE# self . frequency = frequency #NEWLINE# self . num_workers = num_workers #NEWLINE# self . weights = master_network . get_weights ( ) #NEWLINE# self . pickled_weights = None #NEWLINE# self . lock = RWLock ( )