Module: TensorFlow::Math

Defined in:
lib/tensorflow/math.rb

Class Method Summary collapse

Class Method Details

.abs(x) ⇒ Object



4
5
6
# File 'lib/tensorflow/math.rb', line 4

def abs(x)
  RawOps.abs(x: x)
end

.acos(x) ⇒ Object

def accumulate_n end



11
12
13
# File 'lib/tensorflow/math.rb', line 11

def acos(x)
  RawOps.acos(x: x)
end

.acosh(x) ⇒ Object



15
16
17
# File 'lib/tensorflow/math.rb', line 15

def acosh(x)
  RawOps.acosh(x: x)
end

.add(x, y) ⇒ Object



19
20
21
# File 'lib/tensorflow/math.rb', line 19

def add(x, y)
  RawOps.add(x: x, y: y)
end

.add_n(inputs) ⇒ Object



23
24
25
# File 'lib/tensorflow/math.rb', line 23

def add_n(inputs)
  RawOps.add_n(inputs: inputs)
end

.angle(input) ⇒ Object



27
28
29
# File 'lib/tensorflow/math.rb', line 27

def angle(input)
  RawOps.angle(input: input)
end

.asin(x) ⇒ Object

def argmin end



37
38
39
# File 'lib/tensorflow/math.rb', line 37

def asin(x)
  RawOps.asin(x: x)
end

.asinh(x) ⇒ Object



41
42
43
# File 'lib/tensorflow/math.rb', line 41

def asinh(x)
  RawOps.asinh(x: x)
end

.atan(x) ⇒ Object



45
46
47
# File 'lib/tensorflow/math.rb', line 45

def atan(x)
  RawOps.atan(x: x)
end

.atan2(y, x) ⇒ Object



49
50
51
# File 'lib/tensorflow/math.rb', line 49

def atan2(y, x)
  RawOps.atan2(y: y, x: x)
end

.atanh(x) ⇒ Object



53
54
55
# File 'lib/tensorflow/math.rb', line 53

def atanh(x)
  RawOps.atanh(x: x)
end

.bessel_i0e(x) ⇒ Object

def bessel_i0 end



60
61
62
# File 'lib/tensorflow/math.rb', line 60

def bessel_i0e(x)
  RawOps.bessel_i0e(x: x)
end

.bessel_i1e(x) ⇒ Object

def bessel_i1 end



67
68
69
# File 'lib/tensorflow/math.rb', line 67

def bessel_i1e(x)
  RawOps.bessel_i1e(x: x)
end

.betainc(a, b, x) ⇒ Object



71
72
73
# File 'lib/tensorflow/math.rb', line 71

def betainc(a, b, x)
  RawOps.betainc(a: a, b: b, x: x)
end

.bincount(arr, size, weights) ⇒ Object



75
76
77
# File 'lib/tensorflow/math.rb', line 75

def bincount(arr, size, weights)
  RawOps.bincount(arr: arr, size: size, weights: weights)
end

.ceil(x) ⇒ Object



79
80
81
# File 'lib/tensorflow/math.rb', line 79

def ceil(x)
  RawOps.ceil(x: x)
end

.conj(input) ⇒ Object

def confusion_matrix end



86
87
88
# File 'lib/tensorflow/math.rb', line 86

def conj(input)
  RawOps.conj(input: input)
end

.cos(x) ⇒ Object



90
91
92
# File 'lib/tensorflow/math.rb', line 90

def cos(x)
  RawOps.cos(x: x)
end

.cosh(x) ⇒ Object



94
95
96
# File 'lib/tensorflow/math.rb', line 94

def cosh(x)
  RawOps.cosh(x: x)
end

.cumprod(x, axis, exclusive: nil, reverse: nil) ⇒ Object

def count_nonzero end



101
102
103
# File 'lib/tensorflow/math.rb', line 101

def cumprod(x, axis, exclusive: nil, reverse: nil)
  RawOps.cumprod(x: x, axis: axis, exclusive: exclusive, reverse: reverse)
end

.cumsum(x, axis, exclusive: nil, reverse: nil) ⇒ Object



105
106
107
# File 'lib/tensorflow/math.rb', line 105

def cumsum(x, axis, exclusive: nil, reverse: nil)
  RawOps.cumsum(x: x, axis: axis, exclusive: exclusive, reverse: reverse)
end

.digamma(x) ⇒ Object

def cumulative_logsumexp end



112
113
114
# File 'lib/tensorflow/math.rb', line 112

def digamma(x)
  RawOps.digamma(x: x)
end

.divide(x, y) ⇒ Object



116
117
118
# File 'lib/tensorflow/math.rb', line 116

def divide(x, y)
  RawOps.div(x: x, y: y)
end

.equal(x, y) ⇒ Object

def divide_no_nan end



123
124
125
# File 'lib/tensorflow/math.rb', line 123

def equal(x, y)
  RawOps.equal(x: x, y: y)
end

.erf(x) ⇒ Object



127
128
129
# File 'lib/tensorflow/math.rb', line 127

def erf(x)
  RawOps.erf(x: x)
end

.erfc(x) ⇒ Object



131
132
133
# File 'lib/tensorflow/math.rb', line 131

def erfc(x)
  RawOps.erfc(x: x)
end

.exp(x) ⇒ Object



135
136
137
# File 'lib/tensorflow/math.rb', line 135

def exp(x)
  RawOps.exp(x: x)
end

.expm1(x) ⇒ Object



139
140
141
# File 'lib/tensorflow/math.rb', line 139

def expm1(x)
  RawOps.expm1(x: x)
end

.floor(x) ⇒ Object



143
144
145
# File 'lib/tensorflow/math.rb', line 143

def floor(x)
  RawOps.floor(x: x)
end

.floordiv(x, y) ⇒ Object



147
148
149
# File 'lib/tensorflow/math.rb', line 147

def floordiv(x, y)
  RawOps.floor_div(x: x, y: y)
end

.floormod(x, y) ⇒ Object



151
152
153
# File 'lib/tensorflow/math.rb', line 151

def floormod(x, y)
  RawOps.floor_mod(x: x, y: y)
end

.greater(x, y) ⇒ Object



155
156
157
# File 'lib/tensorflow/math.rb', line 155

def greater(x, y)
  RawOps.greater(x: x, y: y)
end

.greater_equal(x, y) ⇒ Object



159
160
161
# File 'lib/tensorflow/math.rb', line 159

def greater_equal(x, y)
  RawOps.greater_equal(x: x, y: y)
end

.igamma(a, x) ⇒ Object



163
164
165
# File 'lib/tensorflow/math.rb', line 163

def igamma(a, x)
  RawOps.igamma(a: a, x: x)
end

.igammac(a, x) ⇒ Object



167
168
169
# File 'lib/tensorflow/math.rb', line 167

def igammac(a, x)
  RawOps.igammac(a: a, x: x)
end

.imag(input) ⇒ Object



171
172
173
# File 'lib/tensorflow/math.rb', line 171

def imag(input)
  RawOps.imag(input: input)
end

.in_top_k(predictions, targets, k: nil) ⇒ Object



175
176
177
# File 'lib/tensorflow/math.rb', line 175

def in_top_k(predictions, targets, k: nil)
  RawOps.in_top_k(predictions: predictions, targets: targets, k: k)
end

.invert_permutation(x) ⇒ Object



179
180
181
# File 'lib/tensorflow/math.rb', line 179

def invert_permutation(x)
  RawOps.invert_permutation(x: x)
end

.is_finite(x) ⇒ Object



183
184
185
# File 'lib/tensorflow/math.rb', line 183

def is_finite(x)
  RawOps.is_finite(x: x)
end

.is_inf(x) ⇒ Object



187
188
189
# File 'lib/tensorflow/math.rb', line 187

def is_inf(x)
  RawOps.is_inf(x: x)
end

.is_nan(x) ⇒ Object



191
192
193
# File 'lib/tensorflow/math.rb', line 191

def is_nan(x)
  RawOps.is_nan(x: x)
end

.less(x, y) ⇒ Object

def lbeta end



207
208
209
# File 'lib/tensorflow/math.rb', line 207

def less(x, y)
  RawOps.less(x: x, y: y)
end

.less_equal(x, y) ⇒ Object



211
212
213
# File 'lib/tensorflow/math.rb', line 211

def less_equal(x, y)
  RawOps.less_equal(x: x, y: y)
end

.lgamma(x) ⇒ Object



215
216
217
# File 'lib/tensorflow/math.rb', line 215

def lgamma(x)
  RawOps.lgamma(x: x)
end

.log(x) ⇒ Object



219
220
221
# File 'lib/tensorflow/math.rb', line 219

def log(x)
  RawOps.log(x: x)
end

.log1p(x) ⇒ Object



223
224
225
# File 'lib/tensorflow/math.rb', line 223

def log1p(x)
  RawOps.log1p(x: x)
end

.log_sigmoid(x) ⇒ Object



227
228
229
230
# File 'lib/tensorflow/math.rb', line 227

def log_sigmoid(x)
  x = TensorFlow.convert_to_tensor(x)
  negative(RawOps.softplus(features: -x))
end

.log_softmax(logits) ⇒ Object



232
233
234
# File 'lib/tensorflow/math.rb', line 232

def log_softmax(logits)
  RawOps.log_softmax(logits: logits)
end

.logical_and(x, y) ⇒ Object



236
237
238
# File 'lib/tensorflow/math.rb', line 236

def logical_and(x, y)
  RawOps.logical_and(x: x, y: y)
end

.logical_not(x) ⇒ Object



240
241
242
# File 'lib/tensorflow/math.rb', line 240

def logical_not(x)
  RawOps.logical_not(x: x)
end

.logical_or(x, y) ⇒ Object



244
245
246
# File 'lib/tensorflow/math.rb', line 244

def logical_or(x, y)
  RawOps.logical_or(x: x, y: y)
end

.logical_xor(x, y) ⇒ Object



248
249
250
# File 'lib/tensorflow/math.rb', line 248

def logical_xor(x, y)
  logical_and(logical_or(x, y), logical_not(logical_and(x, y)))
end

.maximum(x, y) ⇒ Object



252
253
254
# File 'lib/tensorflow/math.rb', line 252

def maximum(x, y)
  RawOps.maximum(x: x, y: y)
end

.minimum(x, y) ⇒ Object



256
257
258
# File 'lib/tensorflow/math.rb', line 256

def minimum(x, y)
  RawOps.minimum(x: x, y: y)
end

.mod(x, y) ⇒ Object



260
261
262
# File 'lib/tensorflow/math.rb', line 260

def mod(x, y)
  RawOps.mod(x: x, y: y)
end

.multiply(x, y) ⇒ Object



264
265
266
# File 'lib/tensorflow/math.rb', line 264

def multiply(x, y)
  RawOps.mul(x: x, y: y)
end

.multiply_no_nan(x, y) ⇒ Object



268
269
270
# File 'lib/tensorflow/math.rb', line 268

def multiply_no_nan(x, y)
  RawOps.mul_no_nan(x: x, y: y)
end

.negative(x) ⇒ Object



272
273
274
# File 'lib/tensorflow/math.rb', line 272

def negative(x)
  RawOps.neg(x: x)
end

.not_equal(x, y) ⇒ Object

def nextafter end



279
280
281
# File 'lib/tensorflow/math.rb', line 279

def not_equal(x, y)
  RawOps.not_equal(x: x, y: y)
end

.polygamma(a, x) ⇒ Object



283
284
285
# File 'lib/tensorflow/math.rb', line 283

def polygamma(a, x)
  RawOps.polygamma(a: a, x: x)
end

.pow(x, y) ⇒ Object

def polyval end



290
291
292
# File 'lib/tensorflow/math.rb', line 290

def pow(x, y)
  RawOps.pow(x: x, y: y)
end

.real(input) ⇒ Object



294
295
296
# File 'lib/tensorflow/math.rb', line 294

def real(input)
  RawOps.real(input: input)
end

.reciprocal(x) ⇒ Object



298
299
300
# File 'lib/tensorflow/math.rb', line 298

def reciprocal(x)
  RawOps.reciprocal(x: x)
end

.reduce_any(input_tensor, axis: nil, keepdims: false) ⇒ Object

def reduce_all end



308
309
310
311
312
# File 'lib/tensorflow/math.rb', line 308

def reduce_any(input_tensor, axis: nil, keepdims: false)
  input_tensor = TensorFlow.convert_to_tensor(input_tensor)
  axis ||= reduction_dims(input_tensor)
  RawOps.any(input: input_tensor, reduction_indices: axis, keep_dims: keepdims)
end

.reduce_max(input_tensor, axis: nil, keepdims: false) ⇒ Object

def reduce_logsumexp end



320
321
322
323
324
# File 'lib/tensorflow/math.rb', line 320

def reduce_max(input_tensor, axis: nil, keepdims: false)
  input_tensor = TensorFlow.convert_to_tensor(input_tensor)
  axis ||= reduction_dims(input_tensor)
  RawOps.max(input: input_tensor, reduction_indices: axis, keep_dims: keepdims)
end

.reduce_mean(input_tensor, axis: nil, keepdims: false) ⇒ Object



326
327
328
329
330
# File 'lib/tensorflow/math.rb', line 326

def reduce_mean(input_tensor, axis: nil, keepdims: false)
  input_tensor = TensorFlow.convert_to_tensor(input_tensor)
  axis ||= reduction_dims(input_tensor)
  RawOps.mean(input: input_tensor, reduction_indices: axis, keep_dims: keepdims)
end

.reduce_min(input_tensor, axis: nil, keepdims: false) ⇒ Object



332
333
334
335
336
# File 'lib/tensorflow/math.rb', line 332

def reduce_min(input_tensor, axis: nil, keepdims: false)
  input_tensor = TensorFlow.convert_to_tensor(input_tensor)
  axis ||= reduction_dims(input_tensor)
  RawOps.min(input: input_tensor, reduction_indices: axis, keep_dims: keepdims)
end

.reduce_prod(input_tensor, axis: nil, keepdims: false) ⇒ Object



338
339
340
341
342
# File 'lib/tensorflow/math.rb', line 338

def reduce_prod(input_tensor, axis: nil, keepdims: false)
  input_tensor = TensorFlow.convert_to_tensor(input_tensor)
  axis ||= reduction_dims(input_tensor)
  RawOps.prod(input: input_tensor, reduction_indices: axis, keep_dims: keepdims)
end

.reduce_std(input_tensor, axis: nil, keepdims: false) ⇒ Object



344
345
346
347
# File 'lib/tensorflow/math.rb', line 344

def reduce_std(input_tensor, axis: nil, keepdims: false)
  variance = reduce_variance(input_tensor, axis: axis, keepdims: keepdims)
  sqrt(variance)
end

.reduce_sum(input_tensor, axis: nil, keepdims: false) ⇒ Object



349
350
351
352
353
# File 'lib/tensorflow/math.rb', line 349

def reduce_sum(input_tensor, axis: nil, keepdims: false)
  input_tensor = TensorFlow.convert_to_tensor(input_tensor)
  axis ||= reduction_dims(input_tensor)
  RawOps.sum(input: input_tensor, reduction_indices: axis, keep_dims: keepdims)
end

.reduce_variance(input_tensor, axis: nil, keepdims: false) ⇒ Object



355
356
357
358
359
# File 'lib/tensorflow/math.rb', line 355

def reduce_variance(input_tensor, axis: nil, keepdims: false)
  means = reduce_mean(input_tensor, axis: axis, keepdims: true)
  squared_deviations = RawOps.square(x: input_tensor - means)
  reduce_mean(squared_deviations, axis: axis, keepdims: keepdims)
end

.rint(x) ⇒ Object



361
362
363
# File 'lib/tensorflow/math.rb', line 361

def rint(x)
  RawOps.rint(x: x)
end

.round(x) ⇒ Object



365
366
367
# File 'lib/tensorflow/math.rb', line 365

def round(x)
  RawOps.round(x: x)
end

.rsqrt(x) ⇒ Object



369
370
371
# File 'lib/tensorflow/math.rb', line 369

def rsqrt(x)
  RawOps.rsqrt(x: x)
end

.segment_max(data, segment_ids) ⇒ Object

def scalar_mul end



376
377
378
# File 'lib/tensorflow/math.rb', line 376

def segment_max(data, segment_ids)
  RawOps.segment_max(data: data, segment_ids: segment_ids)
end

.segment_mean(data, segment_ids) ⇒ Object



380
381
382
# File 'lib/tensorflow/math.rb', line 380

def segment_mean(data, segment_ids)
  RawOps.segment_mean(data: data, segment_ids: segment_ids)
end

.segment_min(data, segment_ids) ⇒ Object



384
385
386
# File 'lib/tensorflow/math.rb', line 384

def segment_min(data, segment_ids)
  RawOps.segment_min(data: data, segment_ids: segment_ids)
end

.segment_prod(data, segment_ids) ⇒ Object



388
389
390
# File 'lib/tensorflow/math.rb', line 388

def segment_prod(data, segment_ids)
  RawOps.segment_prod(data: data, segment_ids: segment_ids)
end

.segment_sum(data, segment_ids) ⇒ Object



392
393
394
# File 'lib/tensorflow/math.rb', line 392

def segment_sum(data, segment_ids)
  RawOps.segment_sum(data: data, segment_ids: segment_ids)
end

.sigmoid(x) ⇒ Object



396
397
398
# File 'lib/tensorflow/math.rb', line 396

def sigmoid(x)
  RawOps.sigmoid(x: x)
end

.sign(x) ⇒ Object



400
401
402
# File 'lib/tensorflow/math.rb', line 400

def sign(x)
  RawOps.sign(x: x)
end

.sin(x) ⇒ Object



404
405
406
# File 'lib/tensorflow/math.rb', line 404

def sin(x)
  RawOps.sin(x: x)
end

.sinh(x) ⇒ Object



408
409
410
# File 'lib/tensorflow/math.rb', line 408

def sinh(x)
  RawOps.sinh(x: x)
end

.softmax(logits) ⇒ Object



412
413
414
# File 'lib/tensorflow/math.rb', line 412

def softmax(logits)
  RawOps.softmax(logits: logits)
end

.softplus(features) ⇒ Object



416
417
418
# File 'lib/tensorflow/math.rb', line 416

def softplus(features)
  RawOps.softplus(features: features)
end

.softsign(features) ⇒ Object



420
421
422
# File 'lib/tensorflow/math.rb', line 420

def softsign(features)
  RawOps.softsign(features: features)
end

.sqrt(x) ⇒ Object



424
425
426
# File 'lib/tensorflow/math.rb', line 424

def sqrt(x)
  RawOps.sqrt(x: x)
end

.square(x) ⇒ Object



428
429
430
# File 'lib/tensorflow/math.rb', line 428

def square(x)
  RawOps.square(x: x)
end

.squared_difference(x, y) ⇒ Object



432
433
434
# File 'lib/tensorflow/math.rb', line 432

def squared_difference(x, y)
  RawOps.squared_difference(x: x, y: y)
end

.subtract(x, y) ⇒ Object



436
437
438
# File 'lib/tensorflow/math.rb', line 436

def subtract(x, y)
  RawOps.sub(x: x, y: y)
end

.tan(x) ⇒ Object



440
441
442
# File 'lib/tensorflow/math.rb', line 440

def tan(x)
  RawOps.tan(x: x)
end

.tanh(x) ⇒ Object



444
445
446
# File 'lib/tensorflow/math.rb', line 444

def tanh(x)
  RawOps.tanh(x: x)
end

.top_k(input, k: nil, sorted: nil) ⇒ Object



448
449
450
# File 'lib/tensorflow/math.rb', line 448

def top_k(input, k: nil, sorted: nil)
  RawOps.top_k(input: input, k: k, sorted: sorted)
end

.unsorted_segment_max(data, segment_ids, num_segments) ⇒ Object

def truediv end



455
456
457
# File 'lib/tensorflow/math.rb', line 455

def unsorted_segment_max(data, segment_ids, num_segments)
  RawOps.unsorted_segment_max(data: data, segment_ids: segment_ids, num_segments: num_segments)
end

.unsorted_segment_min(data, segment_ids, num_segments) ⇒ Object

def unsorted_segment_mean end



462
463
464
# File 'lib/tensorflow/math.rb', line 462

def unsorted_segment_min(data, segment_ids, num_segments)
  RawOps.unsorted_segment_min(data: data, segment_ids: segment_ids, num_segments: num_segments)
end

.unsorted_segment_prod(data, segment_ids, num_segments) ⇒ Object



466
467
468
# File 'lib/tensorflow/math.rb', line 466

def unsorted_segment_prod(data, segment_ids, num_segments)
  RawOps.unsorted_segment_prod(data: data, segment_ids: segment_ids, num_segments: num_segments)
end

.unsorted_segment_sum(data, segment_ids, num_segments) ⇒ Object

def unsorted_segment_sqrt_n end



473
474
475
# File 'lib/tensorflow/math.rb', line 473

def unsorted_segment_sum(data, segment_ids, num_segments)
  RawOps.unsorted_segment_sum(data: data, segment_ids: segment_ids, num_segments: num_segments)
end

.xdivy(x, y) ⇒ Object



477
478
479
# File 'lib/tensorflow/math.rb', line 477

def xdivy(x, y)
  RawOps.xdivy(x: x, y: y)
end

.xlogy(x, y) ⇒ Object



481
482
483
# File 'lib/tensorflow/math.rb', line 481

def xlogy(x, y)
  RawOps.xlogy(x: x, y: y)
end

.zeta(x, q) ⇒ Object

def zero_fraction end



488
489
490
# File 'lib/tensorflow/math.rb', line 488

def zeta(x, q)
  RawOps.zeta(x: x, q: q)
end