Commit dd6f395b authored by Stanislav Paláček's avatar Stanislav Paláček

v1.33

Oprava konstantních dat
parent 3cc817bb
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>
\ No newline at end of file
......@@ -23,6 +23,6 @@ if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${dialect}")
add_executable(neuron4dyn src/mod_randomnumbers.f90 src/neurondatatypes.f90 src/neuronka.f90 src/neuron4dyn.f90)
add_executable(neuron4dynstruc src/mod_randomnumbers.f90 src/neurondatatypes.f90 src/neuronka.f90 src/neuron4dynstruc.f90)
# add_executable(neuron4dynstruc src/mod_randomnumbers.f90 src/neurondatatypes.f90 src/neuronka.f90 src/neuron4dynstruc.f90)
endif()
......@@ -59,6 +59,7 @@ program neuron4dyn
if (.not. a%vycislidata) then
call skalujlearndata(a,ucicidata)
call skalujlearndata(a,kontrolnidata)
else
call skalujvstupy(a,vycislenisite)
call vycisli_sit(a,vycislenisite,sigmoid,linear)
......
......@@ -365,11 +365,31 @@ implicit none
subroutine skalujlearndata(sit,ucicidata)
type(network) :: sit
type(learn_dataset) :: ucicidata
integer :: i
real :: tol=1e-1
! naškálování vstupů a výstupů na interval [-1,1]
if (.not. sit%loadedscale) STOP "Nejsou načtené parametry pro škálování"
! $mark
do i=1,size(sit%inpmax)
if(sit%inpmax(i)-sit%inpmin(i) < tol) then
sit%inpmin(i)=0.0
if (sit%inpmax(i) < tol) then
sit%inpmax(i)=1.0
end if
end if
end do
do i=1,size(sit%outmax)
if(sit%outmax(i)-sit%outmin(i) < tol) then
sit%outmin(i)=0.0
if (sit%outmax(i) < tol) then
sit%outmax(i)=1.0
end if
end if
end do
do i=1,ucicidata%nprvku
ucicidata%vstupy(:,i)=2*(ucicidata%vstupy(:,i)-sit%inpmin)/(sit%inpmax-sit%inpmin)-1
ucicidata%vzorvystupy(:,i)=2*(ucicidata%vzorvystupy(:,i)-sit%outmin)/(sit%outmax-sit%outmin)-1
......@@ -780,8 +800,9 @@ end function
type(learn_dataset),intent(in) :: datas
real :: kvchybfun
kvchybfun=0.5*sum((datas%vystupy-datas%vzorvystupy)**2)/datas%nprvku
end function kvchybfun
function gradkvchybfun(sit,vzdata)
......@@ -2145,7 +2166,7 @@ end function
call ulozvahy(sit)
print*,"chyba ucicich dat=",sit%chybasite, "chyba testovacich dat=",chybatestn
! print*,"chyba ucicich dat=",sit%chybasite, "chyba testovacich dat=",chybatestn
if (sit%chybasite < targeterr) exit
......@@ -2239,6 +2260,7 @@ end function
real :: t0,t1,t2
kalmanparfile='inifiles/kallman.par'
inquire(file=kalmanparfile,exist=ex)
......@@ -2314,6 +2336,7 @@ end function
! print*,'Doba vypočtu matice H',t2-t1
! call CPU_TIME(t1)
inovace=sqrt(sum((datai%vystupy(:,1)-datai%vzorvystupy(:,1))**2))
! print*,perm(i),'inovace',inovace,datai%vystupy,datai%vzorvystupy
! call CPU_TIME(t2)
......@@ -2463,9 +2486,9 @@ end function
! print*,'Doba vyhodnocení konce epochy ',t2-t1
call CPU_TIME(t2)
if (mod(niter,vzordata%nprvku)==0) then
print*,'Doba iterace',niter,t2-t0, 'epocha=',nepoch
end if
! if (mod(niter,vzordata%nprvku)==0) then
! print*,'Doba iterace',niter,t2-t0, 'epocha=',nepoch
! end if
end do
......@@ -2589,6 +2612,7 @@ end function
integer :: i,j,k,l,p,citac
!>> konstrukce sigvzordata
call sigvzordata%createsignals(sit,vzordata)
!>> konstrukce delty
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment