Jun-23-2018, 02:53 PM
I have a module named optimizer.py which has a class optimizer. The class contains 2 static member functions. Optimizer.py looks something like this:
class optimizer: @staticmethod def gradientDescentOptimizer(input,mappings,net:nn.nn,alpha=0.001,lamb=None, epoch=100,print_at=5,prnt=True): #Code @staticmethod def SGDOptimizer(input,mappings,net:nn.nn,mini_batch_size=64,alpha=0.001,lamb=None, epoch=5,print_at=5,prnt=True): #codeTo access the functions in other modules, I need to follow this syntax:
import optimizer x = optimizer.optimizer.functionName(arguments)I was wondering if there is a way to expand the scope of the optimizer class so that the function can be accessed by referring to the optimizer class just once, like this :
import optimizer x = optimizer.functionName(arguments)