Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lib4neuro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MolDyn
lib4neuro
Commits
868c793a
Commit
868c793a
authored
7 years ago
by
Martin Beseda
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Enhanced formatting in module connection_m
parent
7faceb58
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/connection_m.f90
+90
-90
90 additions, 90 deletions
src/connection_m.f90
with
90 additions
and
90 deletions
src/connection_m.f90
+
90
−
90
View file @
868c793a
...
@@ -70,23 +70,6 @@ module connection_m
...
@@ -70,23 +70,6 @@ module connection_m
end
type
connection_t
end
type
connection_t
!> Represents a connection between two neurons.
!! Able to pass a signal from an input neuron to
!! an output one.
type
,
extends
(
connection_t
)
::
interval_connection_t
contains
!> Passes (assigns) the product
!! input neuron state * weight)
!! to an output neuron.
!! @todo Rewrite implementation to "interval"
procedure
::
pass_signal
=>
pass_signal_interval_impl
end
type
interval_connection_t
!------------!------------------------------------------------------------------------------
! Interfaces !
!------------!
interface
connection_t
interface
connection_t
!> Constructor of connection_t class
!> Constructor of connection_t class
!! @param input_neuron Pointer to the input neuron (instance of neuron_t)
!! @param input_neuron Pointer to the input neuron (instance of neuron_t)
...
@@ -100,6 +83,20 @@ module connection_m
...
@@ -100,6 +83,20 @@ module connection_m
module
procedure
::
new_connection_3
module
procedure
::
new_connection_3
end
interface
connection_t
end
interface
connection_t
!> Represents a connection between two neurons.
!! Able to pass a signal from an input neuron to
!! an output one.
type
,
extends
(
connection_t
)
::
interval_connection_t
contains
!> Passes (assigns) the product
!! input neuron state * weight)
!! to an output neuron.
!! @todo Rewrite implementation to "interval"
procedure
::
pass_signal
=>
pass_signal_interval_impl
end
type
interval_connection_t
interface
interval_connection_t
interface
interval_connection_t
!> Constructor of interval_connection_t class
!> Constructor of interval_connection_t class
!! @param input_neuron Pointer to the input neuron (instance of neuron_t)
!! @param input_neuron Pointer to the input neuron (instance of neuron_t)
...
@@ -167,6 +164,82 @@ module connection_m
...
@@ -167,6 +164,82 @@ module connection_m
#endif
#endif
end
function
new_connection_3
end
function
new_connection_3
!-------------!--------------------------------------------------------------------------
! Destructors !
!-------------!
subroutine
destroy_connection
(
this
)
type
(
connection_t
),
intent
(
inout
)
::
this
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
call
this
%
nullify_pointers
()
#ifdef TIME_PROFILING
call
time_profiling_start
(
start_time
,
'destroy_connection'
)
#endif
end
subroutine
destroy_connection
subroutine
destroy_connection_array
(
this
)
type
(
connection_t
),
intent
(
inout
)
::
this
(:)
integer
::
i
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
do
i
=
1
,
size
(
this
)
call
this
(
i
)
%
nullify_pointers
()
end
do
#ifdef TIME_PROFILING
call
time_profiling_stop
(
start_time
,
'destroy_connection_array'
)
#endif
end
subroutine
destroy_connection_array
!-------------------!-------------------------------------------------------------------
! Getters & Setters !
!-------------------!
function
get_input_neuron_impl
(
this
)
result
(
input_neuron
)
class
(
connection_t
),
target
,
intent
(
in
)
::
this
class
(
neuron_t
),
pointer
::
input_neuron
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
input_neuron
=>
this
%
input_neuron
#ifdef TIME_PROFILING
call
time_profiling_stop
(
start_time
,
'get_input_neuron_impl'
)
#endif
end
function
get_input_neuron_impl
function
get_output_neuron_impl
(
this
)
result
(
output_neuron
)
class
(
connection_t
),
target
,
intent
(
in
)
::
this
class
(
neuron_t
),
pointer
::
output_neuron
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
output_neuron
=>
this
%
output_neuron
#ifdef TIME_PROFILING
call
time_profiling_stop
(
start_time
,
'get_output_neuron_impl'
)
#endif
end
function
get_output_neuron_impl
function
get_weight_impl
(
this
)
result
(
weight
)
class
(
connection_t
),
intent
(
in
)
::
this
real
::
weight
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
weight
=
this
%
weight
#ifdef TIME_PROFILING
call
time_profiling_stop
(
start_time
,
'get_weight_impl'
)
#endif
end
function
get_weight_impl
!----------------!-------------------------------------------------------------------------
! Common methods !
!----------------!
subroutine
init_components_impl
(
this
,
input_neuron
,
output_neuron
,
weight
)
subroutine
init_components_impl
(
this
,
input_neuron
,
output_neuron
,
weight
)
class
(
connection_t
),
intent
(
inout
)
::
this
class
(
connection_t
),
intent
(
inout
)
::
this
type
(
neuron_t
),
pointer
::
input_neuron
type
(
neuron_t
),
pointer
::
input_neuron
...
@@ -225,37 +298,6 @@ module connection_m
...
@@ -225,37 +298,6 @@ module connection_m
#endif
#endif
end
subroutine
pass_signal_impl
end
subroutine
pass_signal_impl
!-------------!--------------------------------------------------------------------------
! Destructors !
!-------------!
subroutine
destroy_connection
(
this
)
type
(
connection_t
),
intent
(
inout
)
::
this
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
call
this
%
nullify_pointers
()
#ifdef TIME_PROFILING
call
time_profiling_start
(
start_time
,
'destroy_connection'
)
#endif
end
subroutine
destroy_connection
subroutine
destroy_connection_array
(
this
)
type
(
connection_t
),
intent
(
inout
)
::
this
(:)
integer
::
i
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
do
i
=
1
,
size
(
this
)
call
this
(
i
)
%
nullify_pointers
()
end
do
#ifdef TIME_PROFILING
call
time_profiling_stop
(
start_time
,
'destroy_connection_array'
)
#endif
end
subroutine
destroy_connection_array
!-----------------------------!
!-----------------------------!
! class interval_connection_t !
! class interval_connection_t !
!-----------------------------!
!-----------------------------!
...
@@ -312,48 +354,6 @@ module connection_m
...
@@ -312,48 +354,6 @@ module connection_m
#endif
#endif
end
function
new_interval_connection_3
end
function
new_interval_connection_3
!-------------------!-------------------------------------------------------------------
! Getters & Setters !
!-------------------!
function
get_input_neuron_impl
(
this
)
result
(
input_neuron
)
class
(
connection_t
),
target
,
intent
(
in
)
::
this
class
(
neuron_t
),
pointer
::
input_neuron
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
input_neuron
=>
this
%
input_neuron
#ifdef TIME_PROFILING
call
time_profiling_stop
(
start_time
,
'get_input_neuron_impl'
)
#endif
end
function
get_input_neuron_impl
function
get_output_neuron_impl
(
this
)
result
(
output_neuron
)
class
(
connection_t
),
target
,
intent
(
in
)
::
this
class
(
neuron_t
),
pointer
::
output_neuron
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
output_neuron
=>
this
%
output_neuron
#ifdef TIME_PROFILING
call
time_profiling_stop
(
start_time
,
'get_output_neuron_impl'
)
#endif
end
function
get_output_neuron_impl
function
get_weight_impl
(
this
)
result
(
weight
)
class
(
connection_t
),
intent
(
in
)
::
this
real
::
weight
#ifdef TIME_PROFILING
real
::
start_time
call
time_profiling_start
(
start_time
)
#endif
weight
=
this
%
weight
#ifdef TIME_PROFILING
call
time_profiling_stop
(
start_time
,
'get_weight_impl'
)
#endif
end
function
get_weight_impl
end
module
connection_m
end
module
connection_m
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment