FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/src/TensorFlowNET.Core/Util/Data.cs at master · feelsyt/TensorFlow.NET · GitHub
feelsyt
/
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
/
TensorFlowNET.Core
/
Util
/
Data.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
78 lines (67 loc) · 2.97 KB
Breadcrumbs
TensorFlow.NET
/
src
/
TensorFlowNET.Core
/
Util
/
Data.cs
Copy path
File metadata and controls
78 lines (67 loc) · 2.97 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using
OneOf
;
using
Tensorflow
.
NumPy
;
namespace
Tensorflow
.
Util
{
/// <summary>
/// ValidationDataPack is used to pass validation data to fit method.
/// It can recive data which could be A tuple `(x_val, xy_val)` or `(x_val, y_val, sample_weight_val)` of Numpy arrays.
/// </summary>
public
class
ValidationDataPack
{
internal
OneOf
<
NDArray
,
NDArray
[
]
>
val_x
;
internal
NDArray
val_y
;
internal
NDArray
val_sample_weight
=
null
;
public
bool
val_x_is_array
=
false
;
public
ValidationDataPack
(
(
NDArray
,
NDArray
)
validation_data
)
{
this
.
val_x
=
validation_data
.
Item1
;
this
.
val_y
=
validation_data
.
Item2
;
}
public
ValidationDataPack
(
(
NDArray
,
NDArray
,
NDArray
)
validation_data
)
{
this
.
val_x
=
validation_data
.
Item1
;
this
.
val_y
=
validation_data
.
Item2
;
this
.
val_sample_weight
=
validation_data
.
Item3
;
}
public
ValidationDataPack
(
(
IEnumerable
<
NDArray
>
,
NDArray
)
validation_data
)
{
this
.
val_x
=
validation_data
.
Item1
.
ToArray
(
)
;
this
.
val_y
=
validation_data
.
Item2
;
val_x_is_array
=
true
;
}
public
ValidationDataPack
(
(
IEnumerable
<
NDArray
>
,
NDArray
,
NDArray
)
validation_data
)
{
this
.
val_x
=
validation_data
.
Item1
.
ToArray
(
)
;
this
.
val_y
=
validation_data
.
Item2
;
this
.
val_sample_weight
=
validation_data
.
Item3
;
val_x_is_array
=
true
;
}
public
static
implicit
operator
ValidationDataPack
(
(
NDArray
,
NDArray
)
validation_data
)
=>
new
ValidationDataPack
(
validation_data
)
;
public
static
implicit
operator
ValidationDataPack
(
(
NDArray
,
NDArray
,
NDArray
)
validation_data
)
=>
new
ValidationDataPack
(
validation_data
)
;
public
static
implicit
operator
ValidationDataPack
(
(
IEnumerable
<
NDArray
>
,
NDArray
)
validation_data
)
=>
new
ValidationDataPack
(
validation_data
)
;
public
static
implicit
operator
ValidationDataPack
(
(
IEnumerable
<
NDArray
>
,
NDArray
,
NDArray
)
validation_data
)
=>
new
ValidationDataPack
(
validation_data
)
;
public
void
Deconstruct
(
out
NDArray
val_x
,
out
NDArray
val_y
)
{
val_x
=
this
.
val_x
.
AsT0
;
val_y
=
this
.
val_y
;
}
public
void
Deconstruct
(
out
NDArray
val_x
,
out
NDArray
val_y
,
out
NDArray
val_sample_weight
)
{
val_x
=
this
.
val_x
.
AsT0
;
val_y
=
this
.
val_y
;
val_sample_weight
=
this
.
val_sample_weight
;
}
// add a unuse parameter to make it different from Deconstruct(out NDArray val_x, out NDArray val_y, out NDArray val_sample_weight)
public
void
Deconstruct
(
out
NDArray
[
]
val_x_array
,
out
NDArray
val_y
,
out
NDArray
val_sample_weight
,
out
NDArray
unuse
)
{
val_x_array
=
this
.
val_x
.
AsT1
;
val_y
=
this
.
val_y
;
val_sample_weight
=
this
.
val_sample_weight
;
unuse
=
null
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL