-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File formatting, small style improvements, couple README edits
- Loading branch information
1 parent
febb8fa
commit c1b158f
Showing
8 changed files
with
2,825 additions
and
2,808 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
!!--------------------------------------------------------------------------------------------------------------------- | ||
!! This program demonstrates the use of the nnqs module. | ||
!!--------------------------------------------------------------------------------------------------------------------- | ||
program main | ||
!------------------------------------------------------------------------------------------------------------------ | ||
!! This program demonstrates the use of the nnqs module. | ||
!------------------------------------------------------------------------------------------------------------------ | ||
use, intrinsic :: iso_fortran_env, only: rk=>real64 | ||
use nnqs, only: RestrictedBoltzmannMachine !! Neural network | ||
implicit none (type,external) !! No implicit types or interfaces | ||
use nnqs, only: RestrictedBoltzmannMachine !! Neural network type | ||
implicit none (type,external) !! No implicit types or interfaces | ||
|
||
!! Variable Declarations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
type(RestrictedBoltzmannMachine) :: psi !! Neural network | ||
integer :: spins, hidden_units !! Number of spins and hidden units | ||
type(RestrictedBoltzmannMachine) :: psi !! Neural network | ||
integer :: spins, hidden_units !! Number of spins and hidden units | ||
|
||
!! Begin Executable Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
call random_init(repeatable=.false., image_distinct=.true.) !! Initialize random number generator | ||
call random_init(repeatable=.false., image_distinct=.true.) !! Initialize random number generator | ||
|
||
spins = 1000 !! Set number of visible units | ||
hidden_units = 50 !! Set number of hidden units | ||
spins = 1000 !! Set number of visible units | ||
hidden_units = 50 !! Set number of hidden units | ||
|
||
psi = RestrictedBoltzmannMachine(v_units=spins, h_units=hidden_units) !! Create instance | ||
psi = RestrictedBoltzmannMachine(v_units=spins, h_units=hidden_units) !! Create instance | ||
|
||
call psi%stochastic_optimization(ising_strengths=[ 0.5_rk, 0.1_rk ]) !! Input [J,B] | ||
call psi%stochastic_optimization(ising_strengths=[ -0.5_rk, 0.1_rk ]) !! Input [J,B] | ||
|
||
end program main |
Oops, something went wrong.