Skip to content

Conversation

@ivan-pi
Copy link
Contributor

@ivan-pi ivan-pi commented Jun 23, 2019

Hello Milan,

The save and load functions should now also load the metadata. I was not sure what to do about the first layer, is it always supposed to have a sigmoid function? I made the function simply save and load all layers.

I took the freedom to change the set_activation function of the layer_type to an elemental subroutine and added a second thin wrapper in the network_type class. This way, different functions can be set for each individual layer using the syntax:

call net % set_activation([character(len=10) :: 'sigmoid', 'tanh', 'gaussian']) ! 3 layer network

The same could be done for the network constructor.

The test_network_save test has been modified to test also the activation functions are matching (by procedure pointer association).

This pull request will make old saved network files broken, and will need to be manually edited to include the missing metadata.

@milancurcic milancurcic marked this pull request as ready for review June 24, 2019 11:04
@milancurcic milancurcic merged commit ea45129 into modern-fortran:master Jun 24, 2019
@milancurcic
Copy link
Member

I was not sure what to do about the first layer, is it always supposed to have a sigmoid function?

For feed-forward networks (currently the only kind supported), the first layer is only an input layer so the activation function is never used. Other kinds of networks may use it, so let's keep this the way you made it for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants