Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
memristor ofdm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jin
memristor ofdm
Commits
5e03cbb7
Commit
5e03cbb7
authored
Jun 17, 2022
by
Luhan Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename file
parent
41029b71
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
main.py
main.py
+1
-1
modules/memristor.py
modules/memristor.py
+18
-0
No files found.
main.py
View file @
5e03cbb7
from
modules.
M
emristor
import
Memristor
from
modules.
m
emristor
import
Memristor
if
__name__
==
'__main__'
:
memr
=
Memristor
(
1
,
1
,
"Gaussian"
)
...
...
modules/memristor.py
View file @
5e03cbb7
import
random
import
numpy
as
np
class
Memristor
:
def
__init__
(
self
,
ratio
,
noise_param
,
noise_pattern
=
"Gaussian"
):
self
.
ratio
=
ratio
self
.
noise_param
=
noise_param
self
.
noise_pattern
=
noise_pattern
def
multiply
(
self
,
inputV
,
controlV
):
precise_ret
=
inputV
*
(
self
.
ratio
/
controlV
)
## 这里描述了忆阻器特性,请根据实际情况修改
print
(
precise_ret
)
if
self
.
noise_pattern
==
"Gaussian"
:
ret
=
np
.
random
.
normal
(
precise_ret
,
self
.
noise_param
,
size
=
None
)
else
:
ret
=
precise_ret
return
ret
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment