FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/src/python/simple_rnn.py at master · lcmax/TensorFlow.NET · GitHub
lcmax
/
TensorFlow.NET
Public
forked from
SciSharp/TensorFlow.NET
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
TensorFlow.NET
/
src
/
python
/
simple_rnn.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (13 loc) · 562 Bytes
Breadcrumbs
TensorFlow.NET
/
src
/
python
/
simple_rnn.py
Copy path
File metadata and controls
17 lines (13 loc) · 562 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import
numpy
as
np
import
tensorflow
as
tf
import
tensorflow
.
experimental
.
numpy
as
tnp
# tf.experimental.numpy
inputs
=
np
.
arange
(
6
*
10
*
8
).
reshape
([
6
,
10
,
8
]).
astype
(
np
.
float32
)
# simple_rnn = tf.keras.layers.SimpleRNN(4)
# output = simple_rnn(inputs) # The output has shape `[6, 4]`.
simple_rnn
=
tf
.
keras
.
layers
.
SimpleRNN
(
4
,
return_sequences
=
True
,
return_state
=
True
)
# whole_sequence_output has shape `[6, 10, 4]`.
# final_state has shape `[6, 4]`.
whole_sequence_output
,
final_state
=
simple_rnn
(
inputs
)
print
(
whole_sequence_output
)
print
(
final_state
)
Back
|
FazBrowse Home
|
New Git URL