tensorflow-ruby 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +18 -0
- data/LICENSE.txt +22 -0
- data/README.md +104 -0
- data/lib/datasets/download_manager.rb +49 -0
- data/lib/datasets/images/mnist.rb +54 -0
- data/lib/datasets/resource.rb +19 -0
- data/lib/tensorflow-ruby.rb +182 -0
- data/lib/tensorflow.rb +1 -0
- data/lib/tensorflow/batchable_type_spec.rb +4 -0
- data/lib/tensorflow/core/framework/allocation_description_pb.rb +21 -0
- data/lib/tensorflow/core/framework/api_def_pb.rb +59 -0
- data/lib/tensorflow/core/framework/attr_value_pb.rb +46 -0
- data/lib/tensorflow/core/framework/cost_graph_pb.rb +49 -0
- data/lib/tensorflow/core/framework/device_attributes_pb.rb +37 -0
- data/lib/tensorflow/core/framework/function_pb.rb +38 -0
- data/lib/tensorflow/core/framework/graph_pb.rb +22 -0
- data/lib/tensorflow/core/framework/graph_transfer_info_pb.rb +73 -0
- data/lib/tensorflow/core/framework/kernel_def_pb.rb +31 -0
- data/lib/tensorflow/core/framework/log_memory_pb.rb +53 -0
- data/lib/tensorflow/core/framework/node_def_pb.rb +27 -0
- data/lib/tensorflow/core/framework/op_def_pb.rb +58 -0
- data/lib/tensorflow/core/framework/reader_base_pb.rb +19 -0
- data/lib/tensorflow/core/framework/remote_fused_graph_execute_info_pb.rb +30 -0
- data/lib/tensorflow/core/framework/resource_handle_pb.rb +28 -0
- data/lib/tensorflow/core/framework/step_stats_pb.rb +72 -0
- data/lib/tensorflow/core/framework/summary_pb.rb +71 -0
- data/lib/tensorflow/core/framework/tensor_description_pb.rb +21 -0
- data/lib/tensorflow/core/framework/tensor_pb.rb +41 -0
- data/lib/tensorflow/core/framework/tensor_shape_pb.rb +22 -0
- data/lib/tensorflow/core/framework/tensor_slice_pb.rb +23 -0
- data/lib/tensorflow/core/framework/types_pb.rb +62 -0
- data/lib/tensorflow/core/framework/variable_pb.rb +45 -0
- data/lib/tensorflow/core/framework/versions_pb.rb +18 -0
- data/lib/tensorflow/core/lib/core/error_codes_pb.rb +35 -0
- data/lib/tensorflow/core/protobuf/cluster_pb.rb +21 -0
- data/lib/tensorflow/core/protobuf/config_pb.rb +180 -0
- data/lib/tensorflow/core/protobuf/control_flow_pb.rb +48 -0
- data/lib/tensorflow/core/protobuf/conv_autotuning_pb.rb +29 -0
- data/lib/tensorflow/core/protobuf/critical_section_pb.rb +21 -0
- data/lib/tensorflow/core/protobuf/debug_pb.rb +38 -0
- data/lib/tensorflow/core/protobuf/device_properties_pb.rb +33 -0
- data/lib/tensorflow/core/protobuf/eager_service_pb.rb +112 -0
- data/lib/tensorflow/core/protobuf/graph_debug_info_pb.rb +29 -0
- data/lib/tensorflow/core/protobuf/master_pb.rb +123 -0
- data/lib/tensorflow/core/protobuf/master_service_pb.rb +15 -0
- data/lib/tensorflow/core/protobuf/meta_graph_pb.rb +95 -0
- data/lib/tensorflow/core/protobuf/named_tensor_pb.rb +18 -0
- data/lib/tensorflow/core/protobuf/queue_runner_pb.rb +21 -0
- data/lib/tensorflow/core/protobuf/replay_log_pb.rb +48 -0
- data/lib/tensorflow/core/protobuf/rewriter_config_pb.rb +81 -0
- data/lib/tensorflow/core/protobuf/saved_model_pb.rb +18 -0
- data/lib/tensorflow/core/protobuf/saved_object_graph_pb.rb +87 -0
- data/lib/tensorflow/core/protobuf/saver_pb.rb +28 -0
- data/lib/tensorflow/core/protobuf/struct_pb.rb +81 -0
- data/lib/tensorflow/core/protobuf/tensor_bundle_pb.rb +37 -0
- data/lib/tensorflow/core/protobuf/tensorflow_server_pb.rb +22 -0
- data/lib/tensorflow/core/protobuf/trace_events_pb.rb +39 -0
- data/lib/tensorflow/core/protobuf/trackable_object_graph_pb.rb +40 -0
- data/lib/tensorflow/core/protobuf/transport_options_pb.rb +16 -0
- data/lib/tensorflow/core/protobuf/verifier_config_pb.rb +23 -0
- data/lib/tensorflow/core/protobuf/worker_pb.rb +246 -0
- data/lib/tensorflow/core/protobuf/worker_service_pb.rb +15 -0
- data/lib/tensorflow/core/util/event_pb.rb +93 -0
- data/lib/tensorflow/core/util/memmapped_file_system_pb.rb +22 -0
- data/lib/tensorflow/core/util/saved_tensor_slice_pb.rb +40 -0
- data/lib/tensorflow/data/batch_dataset.rb +18 -0
- data/lib/tensorflow/data/dataset.rb +106 -0
- data/lib/tensorflow/data/fixed_length_record_dataset.rb +27 -0
- data/lib/tensorflow/data/iterator.rb +76 -0
- data/lib/tensorflow/data/map_dataset.rb +17 -0
- data/lib/tensorflow/data/repeat_dataset.rb +16 -0
- data/lib/tensorflow/data/shuffle_dataset.rb +23 -0
- data/lib/tensorflow/data/tensor_dataset.rb +19 -0
- data/lib/tensorflow/data/tensor_slice_dataset.rb +15 -0
- data/lib/tensorflow/data/tf_record_dataset.rb +18 -0
- data/lib/tensorflow/data/zip_dataset.rb +24 -0
- data/lib/tensorflow/decorators.rb +53 -0
- data/lib/tensorflow/eager/context.rb +120 -0
- data/lib/tensorflow/eager/operation.rb +219 -0
- data/lib/tensorflow/eager/tensor_handle.rb +87 -0
- data/lib/tensorflow/error.rb +54 -0
- data/lib/tensorflow/execution_context.rb +62 -0
- data/lib/tensorflow/extensions/arg_def.rb +58 -0
- data/lib/tensorflow/extensions/array.rb +17 -0
- data/lib/tensorflow/extensions/boolean.rb +25 -0
- data/lib/tensorflow/extensions/narray.rb +7 -0
- data/lib/tensorflow/ffi.rb +291 -0
- data/lib/tensorflow/graph/function.rb +33 -0
- data/lib/tensorflow/graph/function_def.rb +62 -0
- data/lib/tensorflow/graph/gradients.rb +120 -0
- data/lib/tensorflow/graph/graph.rb +252 -0
- data/lib/tensorflow/graph/graph_def_options.rb +24 -0
- data/lib/tensorflow/graph/graph_keys.rb +50 -0
- data/lib/tensorflow/graph/operation.rb +176 -0
- data/lib/tensorflow/graph/operation_attr.rb +153 -0
- data/lib/tensorflow/graph/operation_description.rb +255 -0
- data/lib/tensorflow/graph/operation_output.rb +49 -0
- data/lib/tensorflow/graph/session.rb +156 -0
- data/lib/tensorflow/keras/datasets/boston_housing.rb +32 -0
- data/lib/tensorflow/keras/datasets/cifar10.rb +11 -0
- data/lib/tensorflow/keras/datasets/cifar100.rb +11 -0
- data/lib/tensorflow/keras/datasets/fashion_mnist.rb +44 -0
- data/lib/tensorflow/keras/datasets/imdb.rb +30 -0
- data/lib/tensorflow/keras/datasets/mnist.rb +18 -0
- data/lib/tensorflow/keras/datasets/reuters.rb +28 -0
- data/lib/tensorflow/keras/layers/conv.rb +14 -0
- data/lib/tensorflow/keras/layers/conv2d.rb +11 -0
- data/lib/tensorflow/keras/layers/dense.rb +68 -0
- data/lib/tensorflow/keras/layers/dropout.rb +27 -0
- data/lib/tensorflow/keras/layers/flatten.rb +25 -0
- data/lib/tensorflow/keras/losses/sparse_categorical_crossentropy.rb +14 -0
- data/lib/tensorflow/keras/metrics/mean.rb +30 -0
- data/lib/tensorflow/keras/metrics/sparse_categorical_accuracy.rb +17 -0
- data/lib/tensorflow/keras/model.rb +6 -0
- data/lib/tensorflow/keras/models/sequential.rb +56 -0
- data/lib/tensorflow/keras/optimizers/adam.rb +8 -0
- data/lib/tensorflow/keras/preprocessing/image.rb +22 -0
- data/lib/tensorflow/keras/utils.rb +83 -0
- data/lib/tensorflow/name_scope.rb +57 -0
- data/lib/tensorflow/op_def_builder.rb +49 -0
- data/lib/tensorflow/ops/audio.rb +13 -0
- data/lib/tensorflow/ops/bitwise.rb +29 -0
- data/lib/tensorflow/ops/control.rb +13 -0
- data/lib/tensorflow/ops/gradients.rb +21 -0
- data/lib/tensorflow/ops/image.rb +218 -0
- data/lib/tensorflow/ops/io.rb +123 -0
- data/lib/tensorflow/ops/linalg.rb +131 -0
- data/lib/tensorflow/ops/math.rb +493 -0
- data/lib/tensorflow/ops/nn.rb +286 -0
- data/lib/tensorflow/ops/operators.rb +31 -0
- data/lib/tensorflow/ops/ops.rb +102 -0
- data/lib/tensorflow/ops/random.rb +18 -0
- data/lib/tensorflow/ops/raw_ops.rb +5179 -0
- data/lib/tensorflow/ops/raw_ops.rb.erb +38 -0
- data/lib/tensorflow/printers/graph.erb +80 -0
- data/lib/tensorflow/printers/graph.rb +26 -0
- data/lib/tensorflow/printers/graph_def.erb +109 -0
- data/lib/tensorflow/printers/graph_def.rb +26 -0
- data/lib/tensorflow/python_compatiblity.rb +55 -0
- data/lib/tensorflow/resource_summary_writer.rb +78 -0
- data/lib/tensorflow/status.rb +49 -0
- data/lib/tensorflow/stream_executor/dnn_pb.rb +90 -0
- data/lib/tensorflow/strings.rb +100 -0
- data/lib/tensorflow/summary.rb +13 -0
- data/lib/tensorflow/tensor.rb +133 -0
- data/lib/tensorflow/tensor_data.rb +310 -0
- data/lib/tensorflow/tensor_mixin.rb +32 -0
- data/lib/tensorflow/tensor_spec.rb +10 -0
- data/lib/tensorflow/tensorflow/core/util/event_pb.rb +93 -0
- data/lib/tensorflow/train/gradient_descent_optimizer.rb +33 -0
- data/lib/tensorflow/train/optimizer.rb +158 -0
- data/lib/tensorflow/type_spec.rb +4 -0
- data/lib/tensorflow/variable.rb +127 -0
- data/lib/tensorflow/version.rb +3 -0
- metadata +308 -0
@@ -0,0 +1,493 @@
|
|
1
|
+
module Tensorflow
|
2
|
+
module Math
|
3
|
+
class << self
|
4
|
+
def abs(x, dtype: nil)
|
5
|
+
RawOps.abs(x, typeT: dtype)
|
6
|
+
end
|
7
|
+
|
8
|
+
# def accumulate_n
|
9
|
+
# end
|
10
|
+
|
11
|
+
def acos(x, dtype: nil)
|
12
|
+
RawOps.acos(x, typeT: dtype)
|
13
|
+
end
|
14
|
+
|
15
|
+
def acosh(x, dtype: nil)
|
16
|
+
RawOps.acosh(x, typeT: dtype)
|
17
|
+
end
|
18
|
+
|
19
|
+
def add(x, y, dtype: nil)
|
20
|
+
RawOps.add(x, y, typeT: dtype)
|
21
|
+
end
|
22
|
+
|
23
|
+
def add_n(inputs, dtype: nil)
|
24
|
+
RawOps.add_n(inputs, n: inputs.length, typeT: dtype)
|
25
|
+
end
|
26
|
+
|
27
|
+
def angle(input, dtype: nil)
|
28
|
+
RawOps.angle(input, typeT: dtype)
|
29
|
+
end
|
30
|
+
|
31
|
+
# def argmax
|
32
|
+
# end
|
33
|
+
|
34
|
+
# def argmin
|
35
|
+
# end
|
36
|
+
|
37
|
+
def asin(x, dtype: nil)
|
38
|
+
RawOps.asin(x, typeT: dtype)
|
39
|
+
end
|
40
|
+
|
41
|
+
def asinh(x, dtype: nil)
|
42
|
+
RawOps.asinh(x, typeT: dtype)
|
43
|
+
end
|
44
|
+
|
45
|
+
def atan(x, dtype: nil)
|
46
|
+
RawOps.atan(x, typeT: dtype)
|
47
|
+
end
|
48
|
+
|
49
|
+
def atan2(y, x, dtype: nil)
|
50
|
+
RawOps.atan2(y, x, typeT: dtype)
|
51
|
+
end
|
52
|
+
|
53
|
+
def atanh(x, dtype: nil)
|
54
|
+
RawOps.atanh(x, typeT: dtype)
|
55
|
+
end
|
56
|
+
|
57
|
+
# def bessel_i0
|
58
|
+
# end
|
59
|
+
|
60
|
+
def bessel_i0e(x, dtype: nil)
|
61
|
+
RawOps.bessel_i0e(x, typeT: dtype)
|
62
|
+
end
|
63
|
+
|
64
|
+
# def bessel_i1
|
65
|
+
# end
|
66
|
+
|
67
|
+
def bessel_i1e(x, dtype: nil)
|
68
|
+
RawOps.bessel_i1e(x, typeT: dtype)
|
69
|
+
end
|
70
|
+
|
71
|
+
def betainc(a, b, x, dtype: nil)
|
72
|
+
RawOps.betainc(a, b, x, typeT: dtype)
|
73
|
+
end
|
74
|
+
|
75
|
+
def bincount(arr, size, weights, dtype: nil)
|
76
|
+
RawOps.bincount(arr, size, weights, typeT: dtype)
|
77
|
+
end
|
78
|
+
|
79
|
+
def ceil(x, dtype: nil)
|
80
|
+
RawOps.ceil(x, typeT: dtype)
|
81
|
+
end
|
82
|
+
|
83
|
+
# def confusion_matrix
|
84
|
+
# end
|
85
|
+
|
86
|
+
def conj(input, dtype: nil)
|
87
|
+
RawOps.conj(input, typeT: dtype)
|
88
|
+
end
|
89
|
+
|
90
|
+
def cos(x, dtype: nil)
|
91
|
+
RawOps.cos(x, typeT: dtype)
|
92
|
+
end
|
93
|
+
|
94
|
+
def cosh(x, dtype: nil)
|
95
|
+
RawOps.cosh(x, typeT: dtype)
|
96
|
+
end
|
97
|
+
|
98
|
+
# def count_nonzero
|
99
|
+
# end
|
100
|
+
|
101
|
+
def cumprod(x, axis, exclusive: nil, reverse: nil, dtype: nil)
|
102
|
+
RawOps.cumprod(x, axis, exclusive: exclusive, reverse: reverse, typeT: dtype)
|
103
|
+
end
|
104
|
+
|
105
|
+
def cumsum(x, axis, exclusive: nil, reverse: nil, dtype: nil)
|
106
|
+
RawOps.cumsum(x, axis, exclusive: exclusive, reverse: reverse, typeT: dtype)
|
107
|
+
end
|
108
|
+
|
109
|
+
# def cumulative_logsumexp
|
110
|
+
# end
|
111
|
+
|
112
|
+
def digamma(x, dtype: nil)
|
113
|
+
RawOps.digamma(x, typeT: dtype)
|
114
|
+
end
|
115
|
+
|
116
|
+
def divide(x, y, dtype: nil)
|
117
|
+
RawOps.div(x, y, typeT: dtype)
|
118
|
+
end
|
119
|
+
|
120
|
+
# def divide_no_nan
|
121
|
+
# end
|
122
|
+
|
123
|
+
def equal(x, y, dtype: nil)
|
124
|
+
RawOps.equal(x, y, typeT: dtype)
|
125
|
+
end
|
126
|
+
|
127
|
+
def erf(x, dtype: nil)
|
128
|
+
RawOps.erf(x, typeT: dtype)
|
129
|
+
end
|
130
|
+
|
131
|
+
def erfc(x, dtype: nil)
|
132
|
+
RawOps.erfc(x, typeT: dtype)
|
133
|
+
end
|
134
|
+
|
135
|
+
def exp(x, dtype: nil)
|
136
|
+
RawOps.exp(x, typeT: dtype)
|
137
|
+
end
|
138
|
+
|
139
|
+
def expm1(x, dtype: nil)
|
140
|
+
RawOps.expm1(x, typeT: dtype)
|
141
|
+
end
|
142
|
+
|
143
|
+
def floor(x, dtype: nil)
|
144
|
+
RawOps.floor(x, typeT: dtype)
|
145
|
+
end
|
146
|
+
|
147
|
+
def floordiv(x, y, dtype: nil)
|
148
|
+
RawOps.floor_div(x, y, typeT: dtype)
|
149
|
+
end
|
150
|
+
|
151
|
+
def floormod(x, y, dtype: nil)
|
152
|
+
RawOps.floor_mod(x, y, typeT: dtype)
|
153
|
+
end
|
154
|
+
|
155
|
+
def greater(x, y, dtype: nil)
|
156
|
+
RawOps.greater(x, y, typeT: dtype)
|
157
|
+
end
|
158
|
+
|
159
|
+
def greater_equal(x, y, dtype: nil)
|
160
|
+
RawOps.greater_equal(x, y, typeT: dtype)
|
161
|
+
end
|
162
|
+
|
163
|
+
def igamma(a, x, dtype: nil)
|
164
|
+
RawOps.igamma(a, x, typeT: dtype)
|
165
|
+
end
|
166
|
+
|
167
|
+
def igammac(a, x, dtype: nil)
|
168
|
+
RawOps.igammac(a, x, typeT: dtype)
|
169
|
+
end
|
170
|
+
|
171
|
+
def imag(input, dtype: nil)
|
172
|
+
RawOps.imag(input, typeT: dtype)
|
173
|
+
end
|
174
|
+
|
175
|
+
def in_top_k(predictions, targets, k=nil, dtype: nil)
|
176
|
+
RawOps.in_top_kv2(predictions, targets, k, typeT: dtype)
|
177
|
+
end
|
178
|
+
|
179
|
+
def invert_permutation(x, dtype: nil)
|
180
|
+
RawOps.invert_permutation(x, typeT: dtype)
|
181
|
+
end
|
182
|
+
|
183
|
+
def is_finite(x, dtype: nil)
|
184
|
+
RawOps.is_finite(x, typeT: dtype)
|
185
|
+
end
|
186
|
+
|
187
|
+
def is_inf(x, dtype: nil)
|
188
|
+
RawOps.is_inf(x, typeT: dtype)
|
189
|
+
end
|
190
|
+
|
191
|
+
def is_nan(x, dtype: nil)
|
192
|
+
RawOps.is_nan(x, typeT: dtype)
|
193
|
+
end
|
194
|
+
|
195
|
+
# def is_non_decreasing
|
196
|
+
# end
|
197
|
+
|
198
|
+
# def is_strictly_increasing
|
199
|
+
# end
|
200
|
+
|
201
|
+
# def l2_normalize
|
202
|
+
# end
|
203
|
+
|
204
|
+
# def lbeta
|
205
|
+
# end
|
206
|
+
|
207
|
+
def less(x, y, dtype: nil)
|
208
|
+
RawOps.less(x, y, typeT: dtype)
|
209
|
+
end
|
210
|
+
|
211
|
+
def less_equal(x, y, dtype: nil)
|
212
|
+
RawOps.less_equal(x, y, typeT: dtype)
|
213
|
+
end
|
214
|
+
|
215
|
+
def lgamma(x, dtype: nil)
|
216
|
+
RawOps.lgamma(x, typeT: dtype)
|
217
|
+
end
|
218
|
+
|
219
|
+
def log(x, dtype: nil)
|
220
|
+
RawOps.log(x, typeT: dtype)
|
221
|
+
end
|
222
|
+
|
223
|
+
def log1p(x, dtype: nil)
|
224
|
+
RawOps.log1p(x, typeT: dtype)
|
225
|
+
end
|
226
|
+
|
227
|
+
def log_sigmoid(x, dtype: nil)
|
228
|
+
negative(RawOps.softplus(-x, typeT: nil), dtype: dtype)
|
229
|
+
end
|
230
|
+
|
231
|
+
def log_softmax(logits, dtype: nil)
|
232
|
+
RawOps.log_softmax(logits: logits, typeT: dtype)
|
233
|
+
end
|
234
|
+
|
235
|
+
def logical_and(x, y, dtype: nil)
|
236
|
+
RawOps.logical_and(x, y)
|
237
|
+
end
|
238
|
+
|
239
|
+
def logical_not(x, dtype: nil)
|
240
|
+
RawOps.logical_not(x)
|
241
|
+
end
|
242
|
+
|
243
|
+
def logical_or(x, y, dtype: nil)
|
244
|
+
RawOps.logical_or(x, y)
|
245
|
+
end
|
246
|
+
|
247
|
+
def logical_xor(x, y, dtype: nil)
|
248
|
+
logical_and(logical_or(x, y, dtype: nil), logical_not(logical_and(x, y, dtype: nil), dtype: nil))
|
249
|
+
end
|
250
|
+
|
251
|
+
def maximum(x, y, dtype: nil)
|
252
|
+
RawOps.maximum(x, y, typeT: dtype)
|
253
|
+
end
|
254
|
+
|
255
|
+
def minimum(x, y, dtype: nil)
|
256
|
+
RawOps.minimum(x, y, typeT: dtype)
|
257
|
+
end
|
258
|
+
|
259
|
+
def mod(x, y, dtype: nil)
|
260
|
+
RawOps.mod(x, y, typeT: dtype)
|
261
|
+
end
|
262
|
+
|
263
|
+
def multiply(x, y, dtype: nil)
|
264
|
+
RawOps.mul(x, y, typeT: dtype)
|
265
|
+
end
|
266
|
+
|
267
|
+
def multiply_no_nan(x, y, dtype: nil)
|
268
|
+
RawOps.mul_no_nan(x, y, typeT: dtype)
|
269
|
+
end
|
270
|
+
|
271
|
+
def negative(x, dtype: nil)
|
272
|
+
RawOps.neg(x, typeT: dtype)
|
273
|
+
end
|
274
|
+
|
275
|
+
# def nextafter
|
276
|
+
# end
|
277
|
+
|
278
|
+
def not_equal(x, y, dtype: nil)
|
279
|
+
RawOps.not_equal(x, y, typeT: dtype)
|
280
|
+
end
|
281
|
+
|
282
|
+
def polygamma(a, x, dtype: nil)
|
283
|
+
RawOps.polygamma(a, x, typeT: dtype)
|
284
|
+
end
|
285
|
+
|
286
|
+
# def polyval
|
287
|
+
# end
|
288
|
+
|
289
|
+
def pow(x, y, dtype: nil)
|
290
|
+
RawOps.pow(x, y, typeT: dtype)
|
291
|
+
end
|
292
|
+
|
293
|
+
def real(input, dtype: nil)
|
294
|
+
RawOps.real(input, typeT: dtype)
|
295
|
+
end
|
296
|
+
|
297
|
+
def reciprocal(x, dtype: nil)
|
298
|
+
RawOps.reciprocal(x, typeT: dtype)
|
299
|
+
end
|
300
|
+
|
301
|
+
# def reciprocal_no_nan
|
302
|
+
# end
|
303
|
+
|
304
|
+
# def reduce_all
|
305
|
+
# end
|
306
|
+
|
307
|
+
def reduce_any(input, axis: nil, keepdims: false, dtype: nil)
|
308
|
+
axis ||= reduction_dims(input, dtype: dtype)
|
309
|
+
RawOps.any(input, axis, keep_dims: keepdims)
|
310
|
+
end
|
311
|
+
|
312
|
+
# def reduce_euclidean_norm
|
313
|
+
# end
|
314
|
+
|
315
|
+
# def reduce_logsumexp
|
316
|
+
# end
|
317
|
+
|
318
|
+
def reduce_max(input, axis: nil, keepdims: false, dtype: nil)
|
319
|
+
axis ||= reduction_dims(input, dtype: dtype)
|
320
|
+
RawOps.max(input, axis, keep_dims: keepdims, typeT: dtype)
|
321
|
+
end
|
322
|
+
|
323
|
+
def reduce_mean(input, axis: nil, keepdims: false, dtype: nil)
|
324
|
+
axis ||= reduction_dims(input, dtype: dtype)
|
325
|
+
RawOps.mean(input, axis, keep_dims: keepdims, typeT: dtype)
|
326
|
+
end
|
327
|
+
|
328
|
+
def reduce_min(input, axis: nil, keepdims: false, dtype: nil)
|
329
|
+
axis ||= reduction_dims(input, dtype: dtype)
|
330
|
+
RawOps.min(input, axis, keep_dims: keepdims, typeT: dtype)
|
331
|
+
end
|
332
|
+
|
333
|
+
def reduce_prod(input, axis: nil, keepdims: false, dtype: nil)
|
334
|
+
axis ||= reduction_dims(input, dtype: dtype)
|
335
|
+
RawOps.prod(input, axis, keep_dims: keepdims, typeT: dtype)
|
336
|
+
end
|
337
|
+
|
338
|
+
def reduce_std(input, axis: nil, keepdims: false, dtype: nil)
|
339
|
+
variance = reduce_variance(input, axis: axis, keepdims: keepdims, dtype: dtype)
|
340
|
+
sqrt(variance, dtype: dtype)
|
341
|
+
end
|
342
|
+
|
343
|
+
def reduce_sum(input, axis: nil, keepdims: false, dtype: nil)
|
344
|
+
axis ||= reduction_dims(input, dtype: dtype)
|
345
|
+
RawOps.sum(input, axis, keep_dims: keepdims, typeT: dtype)
|
346
|
+
end
|
347
|
+
|
348
|
+
def reduce_variance(input, axis: nil, keepdims: false, dtype: nil)
|
349
|
+
means = reduce_mean(input, axis: axis, keepdims: true, dtype: dtype)
|
350
|
+
squared_deviations = RawOps.square(input - means, typeT: dtype)
|
351
|
+
reduce_mean(squared_deviations, axis: axis, keepdims: keepdims, dtype: dtype)
|
352
|
+
end
|
353
|
+
|
354
|
+
def rint(x, dtype: nil)
|
355
|
+
RawOps.rint(x, typeT: dtype)
|
356
|
+
end
|
357
|
+
|
358
|
+
def round(x, dtype: nil)
|
359
|
+
RawOps.round(x, typeT: dtype)
|
360
|
+
end
|
361
|
+
|
362
|
+
def rsqrt(x, dtype: nil)
|
363
|
+
RawOps.rsqrt(x, typeT: dtype)
|
364
|
+
end
|
365
|
+
|
366
|
+
# def scalar_mul
|
367
|
+
# end
|
368
|
+
|
369
|
+
def segment_max(data, segment_ids, dtype: nil)
|
370
|
+
RawOps.segment_max(data, segment_ids, typeT: dtype)
|
371
|
+
end
|
372
|
+
|
373
|
+
def segment_mean(data, segment_ids, dtype: nil)
|
374
|
+
RawOps.segment_mean(data, segment_ids, typeT: dtype)
|
375
|
+
end
|
376
|
+
|
377
|
+
def segment_min(data, segment_ids, dtype: nil)
|
378
|
+
RawOps.segment_min(data, segment_ids, typeT: dtype)
|
379
|
+
end
|
380
|
+
|
381
|
+
def segment_prod(data, segment_ids, dtype: nil)
|
382
|
+
RawOps.segment_prod(data, segment_ids, typeT: dtype)
|
383
|
+
end
|
384
|
+
|
385
|
+
def segment_sum(data, segment_ids, dtype: nil)
|
386
|
+
RawOps.segment_sum(data, segment_ids, typeT: dtype)
|
387
|
+
end
|
388
|
+
|
389
|
+
def sigmoid(x, dtype: nil)
|
390
|
+
RawOps.sigmoid(x, typeT: dtype)
|
391
|
+
end
|
392
|
+
|
393
|
+
def sign(x, dtype: nil)
|
394
|
+
RawOps.sign(x, typeT: dtype)
|
395
|
+
end
|
396
|
+
|
397
|
+
def sin(x, dtype: nil)
|
398
|
+
RawOps.sin(x, typeT: dtype)
|
399
|
+
end
|
400
|
+
|
401
|
+
def sinh(x, dtype: nil)
|
402
|
+
RawOps.sinh(x, typeT: dtype)
|
403
|
+
end
|
404
|
+
|
405
|
+
def softmax(logits, dtype: nil)
|
406
|
+
RawOps.softmax(logits: logits, typeT: dtype)
|
407
|
+
end
|
408
|
+
|
409
|
+
def softplus(features, dtype: nil)
|
410
|
+
RawOps.softplus(features: features, typeT: dtype)
|
411
|
+
end
|
412
|
+
|
413
|
+
def softsign(features, dtype: nil)
|
414
|
+
RawOps.softsign(features: features, typeT: dtype)
|
415
|
+
end
|
416
|
+
|
417
|
+
def sqrt(x, dtype: nil)
|
418
|
+
RawOps.sqrt(x, typeT: dtype)
|
419
|
+
end
|
420
|
+
|
421
|
+
def square(x, dtype: nil)
|
422
|
+
RawOps.square(x, typeT: dtype)
|
423
|
+
end
|
424
|
+
|
425
|
+
def squared_difference(x, y, dtype: nil)
|
426
|
+
RawOps.squared_difference(x, y, typeT: dtype)
|
427
|
+
end
|
428
|
+
|
429
|
+
def subtract(x, y, dtype: nil)
|
430
|
+
RawOps.sub(x, y, typeT: dtype)
|
431
|
+
end
|
432
|
+
|
433
|
+
def tan(x, dtype: nil)
|
434
|
+
RawOps.tan(x, typeT: dtype)
|
435
|
+
end
|
436
|
+
|
437
|
+
def tanh(x, dtype: nil)
|
438
|
+
RawOps.tanh(x, typeT: dtype)
|
439
|
+
end
|
440
|
+
|
441
|
+
def top_k(input, k: nil, sorted: nil, dtype: nil)
|
442
|
+
RawOps.top_k(input, k: k, sorted: sorted, typeT: dtype)
|
443
|
+
end
|
444
|
+
|
445
|
+
# def truediv
|
446
|
+
# end
|
447
|
+
|
448
|
+
def unsorted_segment_max(data, segment_ids, num_segments, dtype: nil)
|
449
|
+
RawOps.unsorted_segment_max(data, segment_ids, num_segments: num_segments, typeT: dtype)
|
450
|
+
end
|
451
|
+
|
452
|
+
# def unsorted_segment_mean
|
453
|
+
# end
|
454
|
+
|
455
|
+
def unsorted_segment_min(data, segment_ids, num_segments, dtype: nil)
|
456
|
+
RawOps.unsorted_segment_min(data, segment_ids, num_segments: num_segments, typeT: dtype)
|
457
|
+
end
|
458
|
+
|
459
|
+
def unsorted_segment_prod(data, segment_ids, num_segments, dtype: nil)
|
460
|
+
RawOps.unsorted_segment_prod(data, segment_ids, num_segments: num_segments, typeT: dtype)
|
461
|
+
end
|
462
|
+
|
463
|
+
# def unsorted_segment_sqrt_n
|
464
|
+
# end
|
465
|
+
|
466
|
+
def unsorted_segment_sum(data, segment_ids, num_segments, dtype: nil)
|
467
|
+
RawOps.unsorted_segment_sum(data, segment_ids, num_segments: num_segments, typeT: dtype)
|
468
|
+
end
|
469
|
+
|
470
|
+
def xdivy(x, y, dtype: nil)
|
471
|
+
RawOps.xdivy(x, y, typeT: dtype)
|
472
|
+
end
|
473
|
+
|
474
|
+
def xlogy(x, y, dtype: nil)
|
475
|
+
RawOps.xlogy(x, y, typeT: dtype)
|
476
|
+
end
|
477
|
+
|
478
|
+
# def zero_fraction
|
479
|
+
# end
|
480
|
+
|
481
|
+
def zeta(x, q, dtype: nil)
|
482
|
+
RawOps.zeta(x, q, typeT: dtype)
|
483
|
+
end
|
484
|
+
|
485
|
+
private
|
486
|
+
|
487
|
+
def reduction_dims(input, dtype: nil)
|
488
|
+
rank = Tensorflow.rank(input, typeT: dtype)
|
489
|
+
range = Tensorflow.range(0, rank)
|
490
|
+
end
|
491
|
+
end
|
492
|
+
end
|
493
|
+
end
|