Hi, could you check the example with trainable-variable? I was thinking about two cases:
implementing a Linear layer without torch.nn.
implementing the Loss layer with learable parameter (ex. Center Loss where mean-center is trainable parameters).
Such stuff are easy in TesnotFlow, but I’m not sure if I coded it correctly in PyTorch
Here is the example of my try of implementing the Linear-Layer. I’m not sure if I should implement “parameters()” this or other. Or that maye PyTorch have a function which gather all trainable variable at single list. http://pastebin.com/NkFZJkBW
Here is my try of using learnable variable in loss-function. It seems to work nice, but I’m not sure if I used the pytorch function correctly (as adding additional variable to optimizer) and as I want to one Loss applied to final layer and second to intermediate layer http://pastebin.com/X35jEE54
Could you check if the idea of using PyTorch here is correct? Or I should change sth here.