FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/tools/TensorFlowNET.Console/SimpleRnnTest.cs at master · ShuchenQ/TensorFlow.NET · GitHub
ShuchenQ
TensorFlow.NET
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
TensorFlow.NET
/
tools
/
TensorFlowNET.Console
/
SimpleRnnTest.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (23 loc) · 821 Bytes
Breadcrumbs
TensorFlow.NET
/
tools
/
TensorFlowNET.Console
/
SimpleRnnTest.cs
Copy path
File metadata and controls
26 lines (23 loc) · 821 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
18
19
20
21
22
23
24
25
26
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
Text
;
using
Tensorflow
.
Keras
;
using
Tensorflow
.
NumPy
;
using
static
Tensorflow
.
Binding
;
using
static
Tensorflow
.
KerasApi
;
namespace
Tensorflow
{
public
class
SimpleRnnTest
{
public
void
Run
(
)
{
var
inputs
=
np
.
random
.
random
(
(
6
,
10
,
8
)
)
.
astype
(
np
.
float32
)
;
//var simple_rnn = tf.keras.layers.SimpleRNN(4);
//var output = simple_rnn.Apply(inputs); // The output has shape `[32, 4]`.
var
simple_rnn
=
tf
.
keras
.
layers
.
SimpleRNN
(
4
,
return_sequences
:
true
,
return_state
:
true
)
;
// whole_sequence_output has shape `[32, 10, 4]`.
// final_state has shape `[32, 4]`.
var
(
whole_sequence_output
,
final_states
)
=
simple_rnn
.
Apply
(
inputs
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL