Here is the code of simple.f90. I do not get any output when executing it.
Since I am using ifort 2021, this may indeed be the problem. Would you
have an idea on how to fix this ?
program simple
use nf, only: dense, input, network
implicit none
type(network) :: net
real, allocatable :: x(:), y(:)
integer, parameter :: num_iterations = 500
integer :: n
print '("Simple")'
print '(60("="))'
net = network([ &
input(3), &
dense(5), &
dense(2) &
])
call net % print_info()
x = [0.2, 0.4, 0.6]
y = [0.123456, 0.246802]
do n = 0, num_iterations
call net % forward(x)
call net % backward(y)
call net % update(1.)
if (mod(n, 50) == 0) &
print '(i4,2(3x,f8.6))', n, net % predict(x)
end do
end program simple
I tried to compile simple.f90 but was stopped at line 2 because my system doesn’t have nf.mod and I don’t know how to get it (from a module nf.f90 somewhere?)
short update on the topic, so neural-fortran works really well for me. But now I am trying to use it on a supercalculator that has a newer version of HDF5 (hdf5/1.14.1-2/oneapi-2023.1.0-mpi-cxx-fortran). I don’t manage to compile neural fortran due to the error :
when I look at the libraries of HDF5, we have a libhdf5_hl_fortran.a, suggesting we would need to replace the -lhdf5hl_fortran by -lhdf5_hl_fortran in the compilation line of fpm. Yet I do not know how to change that in fpm. Would anyone have an idea?