torch-rb 0.1.2 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/LICENSE.txt +46 -22
- data/README.md +18 -6
- data/ext/torch/ext.cpp +148 -369
- data/ext/torch/extconf.rb +6 -0
- data/ext/torch/nn_functions.cpp +615 -0
- data/ext/torch/nn_functions.hpp +6 -0
- data/ext/torch/templates.cpp +55 -0
- data/ext/torch/templates.hpp +242 -0
- data/ext/torch/tensor_functions.cpp +1920 -0
- data/ext/torch/tensor_functions.hpp +6 -0
- data/ext/torch/torch_functions.cpp +2975 -0
- data/ext/torch/torch_functions.hpp +6 -0
- data/lib/torch.rb +240 -131
- data/lib/torch/ext.bundle +0 -0
- data/lib/torch/inspector.rb +27 -22
- data/lib/torch/native/dispatcher.rb +48 -0
- data/lib/torch/native/function.rb +109 -0
- data/lib/torch/native/generator.rb +168 -0
- data/lib/torch/native/native_functions.yaml +6837 -0
- data/lib/torch/native/parser.rb +134 -0
- data/lib/torch/nn/alpha_dropout.rb +9 -0
- data/lib/torch/nn/avg_pool1d.rb +18 -0
- data/lib/torch/nn/avg_pool2d.rb +19 -0
- data/lib/torch/nn/avg_pool3d.rb +19 -0
- data/lib/torch/nn/avg_poolnd.rb +9 -0
- data/lib/torch/nn/batch_norm.rb +75 -0
- data/lib/torch/nn/batch_norm1d.rb +11 -0
- data/lib/torch/nn/batch_norm2d.rb +11 -0
- data/lib/torch/nn/batch_norm3d.rb +11 -0
- data/lib/torch/nn/bce_loss.rb +13 -0
- data/lib/torch/nn/bce_with_logits_loss.rb +15 -0
- data/lib/torch/nn/bilinear.rb +38 -0
- data/lib/torch/nn/constant_pad1d.rb +10 -0
- data/lib/torch/nn/constant_pad2d.rb +10 -0
- data/lib/torch/nn/constant_pad3d.rb +10 -0
- data/lib/torch/nn/constant_padnd.rb +18 -0
- data/lib/torch/nn/conv1d.rb +22 -0
- data/lib/torch/nn/conv2d.rb +16 -38
- data/lib/torch/nn/conv3d.rb +22 -0
- data/lib/torch/nn/convnd.rb +41 -0
- data/lib/torch/nn/cosine_embedding_loss.rb +14 -0
- data/lib/torch/nn/cosine_similarity.rb +15 -0
- data/lib/torch/nn/cross_entropy_loss.rb +14 -0
- data/lib/torch/nn/ctc_loss.rb +15 -0
- data/lib/torch/nn/dropout.rb +9 -0
- data/lib/torch/nn/dropout2d.rb +9 -0
- data/lib/torch/nn/dropout3d.rb +9 -0
- data/lib/torch/nn/dropoutnd.rb +15 -0
- data/lib/torch/nn/embedding.rb +52 -0
- data/lib/torch/nn/embedding_bag.rb +34 -0
- data/lib/torch/nn/feature_alpha_dropout.rb +9 -0
- data/lib/torch/nn/fold.rb +20 -0
- data/lib/torch/nn/functional.rb +411 -22
- data/lib/torch/nn/group_norm.rb +36 -0
- data/lib/torch/nn/gru.rb +49 -0
- data/lib/torch/nn/hardshrink.rb +18 -0
- data/lib/torch/nn/hinge_embedding_loss.rb +14 -0
- data/lib/torch/nn/identity.rb +14 -0
- data/lib/torch/nn/init.rb +58 -1
- data/lib/torch/nn/instance_norm.rb +20 -0
- data/lib/torch/nn/instance_norm1d.rb +18 -0
- data/lib/torch/nn/instance_norm2d.rb +11 -0
- data/lib/torch/nn/instance_norm3d.rb +11 -0
- data/lib/torch/nn/kl_div_loss.rb +13 -0
- data/lib/torch/nn/l1_loss.rb +13 -0
- data/lib/torch/nn/layer_norm.rb +35 -0
- data/lib/torch/nn/leaky_relu.rb +20 -0
- data/lib/torch/nn/linear.rb +12 -11
- data/lib/torch/nn/local_response_norm.rb +21 -0
- data/lib/torch/nn/log_sigmoid.rb +9 -0
- data/lib/torch/nn/log_softmax.rb +14 -0
- data/lib/torch/nn/loss.rb +10 -0
- data/lib/torch/nn/lp_pool1d.rb +9 -0
- data/lib/torch/nn/lp_pool2d.rb +9 -0
- data/lib/torch/nn/lp_poolnd.rb +22 -0
- data/lib/torch/nn/lstm.rb +66 -0
- data/lib/torch/nn/margin_ranking_loss.rb +14 -0
- data/lib/torch/nn/max_pool1d.rb +9 -0
- data/lib/torch/nn/max_pool2d.rb +9 -0
- data/lib/torch/nn/max_pool3d.rb +9 -0
- data/lib/torch/nn/max_poolnd.rb +19 -0
- data/lib/torch/nn/max_unpool1d.rb +16 -0
- data/lib/torch/nn/max_unpool2d.rb +16 -0
- data/lib/torch/nn/max_unpool3d.rb +16 -0
- data/lib/torch/nn/max_unpoolnd.rb +9 -0
- data/lib/torch/nn/module.rb +201 -20
- data/lib/torch/nn/mse_loss.rb +2 -2
- data/lib/torch/nn/multi_label_margin_loss.rb +13 -0
- data/lib/torch/nn/multi_label_soft_margin_loss.rb +13 -0
- data/lib/torch/nn/multi_margin_loss.rb +17 -0
- data/lib/torch/nn/nll_loss.rb +14 -0
- data/lib/torch/nn/pairwise_distance.rb +16 -0
- data/lib/torch/nn/parameter.rb +2 -2
- data/lib/torch/nn/poisson_nll_loss.rb +16 -0
- data/lib/torch/nn/prelu.rb +19 -0
- data/lib/torch/nn/reflection_pad1d.rb +10 -0
- data/lib/torch/nn/reflection_pad2d.rb +10 -0
- data/lib/torch/nn/reflection_padnd.rb +13 -0
- data/lib/torch/nn/relu.rb +8 -3
- data/lib/torch/nn/replication_pad1d.rb +10 -0
- data/lib/torch/nn/replication_pad2d.rb +10 -0
- data/lib/torch/nn/replication_pad3d.rb +10 -0
- data/lib/torch/nn/replication_padnd.rb +13 -0
- data/lib/torch/nn/rnn.rb +22 -0
- data/lib/torch/nn/rnn_base.rb +198 -0
- data/lib/torch/nn/sequential.rb +1 -10
- data/lib/torch/nn/sigmoid.rb +9 -0
- data/lib/torch/nn/smooth_l1_loss.rb +13 -0
- data/lib/torch/nn/soft_margin_loss.rb +13 -0
- data/lib/torch/nn/softmax.rb +18 -0
- data/lib/torch/nn/softmax2d.rb +10 -0
- data/lib/torch/nn/softmin.rb +14 -0
- data/lib/torch/nn/softplus.rb +19 -0
- data/lib/torch/nn/softshrink.rb +18 -0
- data/lib/torch/nn/softsign.rb +9 -0
- data/lib/torch/nn/tanh.rb +9 -0
- data/lib/torch/nn/tanhshrink.rb +9 -0
- data/lib/torch/nn/triplet_margin_loss.rb +18 -0
- data/lib/torch/nn/unfold.rb +19 -0
- data/lib/torch/nn/utils.rb +25 -0
- data/lib/torch/nn/weighted_loss.rb +10 -0
- data/lib/torch/nn/zero_pad2d.rb +9 -0
- data/lib/torch/optim/adadelta.rb +57 -0
- data/lib/torch/optim/adagrad.rb +71 -0
- data/lib/torch/optim/adam.rb +81 -0
- data/lib/torch/optim/adamax.rb +68 -0
- data/lib/torch/optim/adamw.rb +82 -0
- data/lib/torch/optim/asgd.rb +65 -0
- data/lib/torch/optim/lr_scheduler/lr_scheduler.rb +33 -0
- data/lib/torch/optim/lr_scheduler/step_lr.rb +17 -0
- data/lib/torch/optim/optimizer.rb +56 -0
- data/lib/torch/optim/rmsprop.rb +76 -0
- data/lib/torch/optim/rprop.rb +68 -0
- data/lib/torch/optim/sgd.rb +48 -16
- data/lib/torch/random.rb +10 -0
- data/lib/torch/tensor.rb +71 -30
- data/lib/torch/utils/data/data_loader.rb +10 -4
- data/lib/torch/utils/data/tensor_dataset.rb +3 -0
- data/lib/torch/version.rb +1 -1
- metadata +123 -6
data/lib/torch/optim/sgd.rb
CHANGED
@@ -1,27 +1,59 @@
|
|
1
|
+
# ported from https://github.com/pytorch/pytorch/blob/master/torch/optim/sgd.py
|
1
2
|
module Torch
|
2
3
|
module Optim
|
3
4
|
class SGD < Optimizer
|
4
|
-
def initialize(params, lr:)
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
def initialize(params, lr:, momentum: 0, dampening: 0, weight_decay: 0, nesterov: false)
|
6
|
+
raise ArgumentError, "Invalid learning rate: #{lr}" if lr < 0.0
|
7
|
+
raise ArgumentError, "Invalid momentum value: #{momentum}" if momentum < 0.0
|
8
|
+
raise ArgumentError, "Invalid weight_decay value: #{weight_decay}" if weight_decay < 0.0
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
param.grad.zero!
|
14
|
-
end
|
10
|
+
defaults = {lr: lr, momentum: momentum, dampening: dampening, weight_decay: weight_decay, nesterov: nesterov}
|
11
|
+
|
12
|
+
if nesterov && (momentum <= 0 || dampening != 0)
|
13
|
+
raise ArgumentError, "Nesterov momentum requires a momentum and zero dampening"
|
15
14
|
end
|
15
|
+
|
16
|
+
super(params, defaults)
|
16
17
|
end
|
17
18
|
|
18
|
-
def step
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
def step(closure = nil)
|
20
|
+
loss = nil
|
21
|
+
if closure
|
22
|
+
loss = closure.call
|
23
|
+
end
|
24
|
+
|
25
|
+
@param_groups.each do |group|
|
26
|
+
weight_decay = group[:weight_decay]
|
27
|
+
momentum = group[:momentum]
|
28
|
+
dampening = group[:dampening]
|
29
|
+
nesterov = group[:nesterov]
|
30
|
+
|
31
|
+
group[:params].each do |p|
|
32
|
+
next unless p.grad
|
33
|
+
d_p = p.grad.data
|
34
|
+
if weight_decay != 0
|
35
|
+
d_p.add!(weight_decay, p.data)
|
36
|
+
end
|
37
|
+
if momentum != 0
|
38
|
+
param_state = @state[p]
|
39
|
+
if !param_state.key(:momentum_buffer)
|
40
|
+
buf = param_state[:momentum_buffer] = Torch.clone(d_p).detach
|
41
|
+
else
|
42
|
+
buf = param_state[:momentum_buffer]
|
43
|
+
buf.mul!(momentum).add!(1 - dampening, d_p)
|
44
|
+
end
|
45
|
+
if nesterov
|
46
|
+
d_p = d_p.add(momentum, buf)
|
47
|
+
else
|
48
|
+
d_p = buf
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
p.data.add!(-group[:lr], d_p)
|
53
|
+
end
|
24
54
|
end
|
55
|
+
|
56
|
+
loss
|
25
57
|
end
|
26
58
|
end
|
27
59
|
end
|
data/lib/torch/random.rb
ADDED
data/lib/torch/tensor.rb
CHANGED
@@ -5,12 +5,8 @@ module Torch
|
|
5
5
|
|
6
6
|
alias_method :requires_grad?, :requires_grad
|
7
7
|
|
8
|
-
def self.new(*
|
9
|
-
|
10
|
-
size.first
|
11
|
-
else
|
12
|
-
Torch.rand(*size)
|
13
|
-
end
|
8
|
+
def self.new(*args)
|
9
|
+
FloatTensor.new(*args)
|
14
10
|
end
|
15
11
|
|
16
12
|
def dtype
|
@@ -28,12 +24,18 @@ module Torch
|
|
28
24
|
end
|
29
25
|
|
30
26
|
def to_a
|
31
|
-
reshape_arr(
|
27
|
+
reshape_arr(_flat_data, shape)
|
28
|
+
end
|
29
|
+
|
30
|
+
# TODO support dtype
|
31
|
+
def to(device, non_blocking: false, copy: false)
|
32
|
+
device = Device.new(device) if device.is_a?(String)
|
33
|
+
_to(device, _dtype, non_blocking, copy)
|
32
34
|
end
|
33
35
|
|
34
36
|
def size(dim = nil)
|
35
37
|
if dim
|
36
|
-
|
38
|
+
_size_int(dim)
|
37
39
|
else
|
38
40
|
shape
|
39
41
|
end
|
@@ -43,31 +45,32 @@ module Torch
|
|
43
45
|
dim.times.map { |i| size(i) }
|
44
46
|
end
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
+
# mirror Python len()
|
49
|
+
def length
|
50
|
+
size(0)
|
48
51
|
end
|
49
52
|
|
50
53
|
def item
|
51
54
|
if numel != 1
|
52
55
|
raise Error, "only one element tensors can be converted to Ruby scalars"
|
53
56
|
end
|
54
|
-
|
57
|
+
_flat_data.first
|
58
|
+
end
|
59
|
+
|
60
|
+
# unsure if this is correct
|
61
|
+
def new
|
62
|
+
Torch.empty(0, dtype: dtype)
|
55
63
|
end
|
56
64
|
|
57
65
|
def backward(gradient = nil)
|
58
|
-
|
59
|
-
_backward_gradient(gradient)
|
60
|
-
else
|
61
|
-
_backward
|
62
|
-
end
|
66
|
+
_backward(gradient)
|
63
67
|
end
|
64
68
|
|
65
69
|
# TODO read directly from memory
|
66
70
|
def numo
|
67
|
-
raise Error, "Numo not found" unless defined?(Numo::NArray)
|
68
71
|
cls = Torch._dtype_to_numo[dtype]
|
69
72
|
raise Error, "Cannot convert #{dtype} to Numo" unless cls
|
70
|
-
cls.cast(
|
73
|
+
cls.cast(_flat_data).reshape(*shape)
|
71
74
|
end
|
72
75
|
|
73
76
|
def new_ones(*size, **options)
|
@@ -84,14 +87,23 @@ module Torch
|
|
84
87
|
_type(enum)
|
85
88
|
end
|
86
89
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
90
|
+
def reshape(*size)
|
91
|
+
# Python doesn't check if size == 1, just ignores later arguments
|
92
|
+
size = size.first if size.size == 1 && size.first.is_a?(Array)
|
93
|
+
_reshape(size)
|
94
|
+
end
|
95
|
+
|
96
|
+
def view(*size)
|
97
|
+
size = size.first if size.size == 1 && size.first.is_a?(Array)
|
98
|
+
_view(size)
|
99
|
+
end
|
100
|
+
|
101
|
+
# value and other are swapped for some methods
|
102
|
+
def add!(value = 1, other)
|
103
|
+
if other.is_a?(Numeric)
|
104
|
+
_add__scalar(other, value)
|
105
|
+
else
|
106
|
+
_add__tensor(other, value)
|
95
107
|
end
|
96
108
|
end
|
97
109
|
|
@@ -127,26 +139,55 @@ module Torch
|
|
127
139
|
item <=> other
|
128
140
|
end
|
129
141
|
|
142
|
+
# based on python_variable_indexing.cpp
|
130
143
|
def [](*indexes)
|
131
144
|
result = self
|
132
145
|
dim = 0
|
133
|
-
indexes.
|
146
|
+
indexes.each do |index|
|
134
147
|
if index.is_a?(Numeric)
|
135
|
-
result = result.
|
148
|
+
result = result._select_int(dim, index)
|
136
149
|
elsif index.is_a?(Range)
|
137
150
|
finish = index.end
|
138
151
|
finish += 1 unless index.exclude_end?
|
139
|
-
result = result.
|
152
|
+
result = result._slice_tensor(dim, index.begin, finish, 1)
|
153
|
+
dim += 1
|
154
|
+
elsif index.nil?
|
155
|
+
result = result.unsqueeze(dim)
|
140
156
|
dim += 1
|
157
|
+
elsif index == true
|
158
|
+
result = result.unsqueeze(dim)
|
159
|
+
# TODO handle false
|
141
160
|
else
|
142
|
-
raise Error, "Unsupported index type"
|
161
|
+
raise Error, "Unsupported index type: #{index.class.name}"
|
143
162
|
end
|
144
163
|
end
|
145
164
|
result
|
146
165
|
end
|
147
166
|
|
167
|
+
# TODO
|
168
|
+
# based on python_variable_indexing.cpp
|
169
|
+
def []=(index, value)
|
170
|
+
raise ArgumentError, "Tensor does not support deleting items" if value.nil?
|
171
|
+
|
172
|
+
value = Torch.tensor(value) unless value.is_a?(Tensor)
|
173
|
+
|
174
|
+
if index.is_a?(Numeric)
|
175
|
+
copy_to(_select_int(0, index), value)
|
176
|
+
elsif index.is_a?(Range)
|
177
|
+
finish = index.end
|
178
|
+
finish += 1 unless index.exclude_end?
|
179
|
+
copy_to(_slice_tensor(0, index.begin, finish, 1), value)
|
180
|
+
else
|
181
|
+
raise Error, "Unsupported index type: #{index.class.name}"
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
148
185
|
private
|
149
186
|
|
187
|
+
def copy_to(dst, src)
|
188
|
+
dst.copy!(src)
|
189
|
+
end
|
190
|
+
|
150
191
|
def reshape_arr(arr, dims)
|
151
192
|
if dims.empty?
|
152
193
|
arr
|
@@ -2,19 +2,25 @@ module Torch
|
|
2
2
|
module Utils
|
3
3
|
module Data
|
4
4
|
class DataLoader
|
5
|
+
include Enumerable
|
6
|
+
|
7
|
+
attr_reader :dataset
|
8
|
+
|
5
9
|
def initialize(dataset, batch_size: 1)
|
6
10
|
@dataset = dataset
|
7
11
|
@batch_size = batch_size
|
8
12
|
end
|
9
13
|
|
10
14
|
def each
|
11
|
-
size
|
12
|
-
|
13
|
-
while start_index < size
|
15
|
+
size.times do |i|
|
16
|
+
start_index = i * @batch_size
|
14
17
|
yield @dataset[start_index...(start_index + @batch_size)]
|
15
|
-
start_index += @batch_size
|
16
18
|
end
|
17
19
|
end
|
20
|
+
|
21
|
+
def size
|
22
|
+
(@dataset.size / @batch_size.to_f).ceil
|
23
|
+
end
|
18
24
|
end
|
19
25
|
end
|
20
26
|
end
|
data/lib/torch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torch-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rice
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,28 +106,145 @@ files:
|
|
106
106
|
- README.md
|
107
107
|
- ext/torch/ext.cpp
|
108
108
|
- ext/torch/extconf.rb
|
109
|
+
- ext/torch/nn_functions.cpp
|
110
|
+
- ext/torch/nn_functions.hpp
|
111
|
+
- ext/torch/templates.cpp
|
112
|
+
- ext/torch/templates.hpp
|
113
|
+
- ext/torch/tensor_functions.cpp
|
114
|
+
- ext/torch/tensor_functions.hpp
|
115
|
+
- ext/torch/torch_functions.cpp
|
116
|
+
- ext/torch/torch_functions.hpp
|
109
117
|
- lib/torch-rb.rb
|
110
118
|
- lib/torch.rb
|
111
119
|
- lib/torch/ext.bundle
|
112
120
|
- lib/torch/inspector.rb
|
121
|
+
- lib/torch/native/dispatcher.rb
|
122
|
+
- lib/torch/native/function.rb
|
123
|
+
- lib/torch/native/generator.rb
|
124
|
+
- lib/torch/native/native_functions.yaml
|
125
|
+
- lib/torch/native/parser.rb
|
126
|
+
- lib/torch/nn/alpha_dropout.rb
|
127
|
+
- lib/torch/nn/avg_pool1d.rb
|
128
|
+
- lib/torch/nn/avg_pool2d.rb
|
129
|
+
- lib/torch/nn/avg_pool3d.rb
|
130
|
+
- lib/torch/nn/avg_poolnd.rb
|
131
|
+
- lib/torch/nn/batch_norm.rb
|
132
|
+
- lib/torch/nn/batch_norm1d.rb
|
133
|
+
- lib/torch/nn/batch_norm2d.rb
|
134
|
+
- lib/torch/nn/batch_norm3d.rb
|
135
|
+
- lib/torch/nn/bce_loss.rb
|
136
|
+
- lib/torch/nn/bce_with_logits_loss.rb
|
137
|
+
- lib/torch/nn/bilinear.rb
|
138
|
+
- lib/torch/nn/constant_pad1d.rb
|
139
|
+
- lib/torch/nn/constant_pad2d.rb
|
140
|
+
- lib/torch/nn/constant_pad3d.rb
|
141
|
+
- lib/torch/nn/constant_padnd.rb
|
142
|
+
- lib/torch/nn/conv1d.rb
|
113
143
|
- lib/torch/nn/conv2d.rb
|
144
|
+
- lib/torch/nn/conv3d.rb
|
145
|
+
- lib/torch/nn/convnd.rb
|
146
|
+
- lib/torch/nn/cosine_embedding_loss.rb
|
147
|
+
- lib/torch/nn/cosine_similarity.rb
|
148
|
+
- lib/torch/nn/cross_entropy_loss.rb
|
149
|
+
- lib/torch/nn/ctc_loss.rb
|
150
|
+
- lib/torch/nn/dropout.rb
|
151
|
+
- lib/torch/nn/dropout2d.rb
|
152
|
+
- lib/torch/nn/dropout3d.rb
|
153
|
+
- lib/torch/nn/dropoutnd.rb
|
154
|
+
- lib/torch/nn/embedding.rb
|
155
|
+
- lib/torch/nn/embedding_bag.rb
|
156
|
+
- lib/torch/nn/feature_alpha_dropout.rb
|
157
|
+
- lib/torch/nn/fold.rb
|
114
158
|
- lib/torch/nn/functional.rb
|
159
|
+
- lib/torch/nn/group_norm.rb
|
160
|
+
- lib/torch/nn/gru.rb
|
161
|
+
- lib/torch/nn/hardshrink.rb
|
162
|
+
- lib/torch/nn/hinge_embedding_loss.rb
|
163
|
+
- lib/torch/nn/identity.rb
|
115
164
|
- lib/torch/nn/init.rb
|
165
|
+
- lib/torch/nn/instance_norm.rb
|
166
|
+
- lib/torch/nn/instance_norm1d.rb
|
167
|
+
- lib/torch/nn/instance_norm2d.rb
|
168
|
+
- lib/torch/nn/instance_norm3d.rb
|
169
|
+
- lib/torch/nn/kl_div_loss.rb
|
170
|
+
- lib/torch/nn/l1_loss.rb
|
171
|
+
- lib/torch/nn/layer_norm.rb
|
172
|
+
- lib/torch/nn/leaky_relu.rb
|
116
173
|
- lib/torch/nn/linear.rb
|
174
|
+
- lib/torch/nn/local_response_norm.rb
|
175
|
+
- lib/torch/nn/log_sigmoid.rb
|
176
|
+
- lib/torch/nn/log_softmax.rb
|
177
|
+
- lib/torch/nn/loss.rb
|
178
|
+
- lib/torch/nn/lp_pool1d.rb
|
179
|
+
- lib/torch/nn/lp_pool2d.rb
|
180
|
+
- lib/torch/nn/lp_poolnd.rb
|
181
|
+
- lib/torch/nn/lstm.rb
|
182
|
+
- lib/torch/nn/margin_ranking_loss.rb
|
183
|
+
- lib/torch/nn/max_pool1d.rb
|
184
|
+
- lib/torch/nn/max_pool2d.rb
|
185
|
+
- lib/torch/nn/max_pool3d.rb
|
186
|
+
- lib/torch/nn/max_poolnd.rb
|
187
|
+
- lib/torch/nn/max_unpool1d.rb
|
188
|
+
- lib/torch/nn/max_unpool2d.rb
|
189
|
+
- lib/torch/nn/max_unpool3d.rb
|
190
|
+
- lib/torch/nn/max_unpoolnd.rb
|
117
191
|
- lib/torch/nn/module.rb
|
118
192
|
- lib/torch/nn/mse_loss.rb
|
193
|
+
- lib/torch/nn/multi_label_margin_loss.rb
|
194
|
+
- lib/torch/nn/multi_label_soft_margin_loss.rb
|
195
|
+
- lib/torch/nn/multi_margin_loss.rb
|
196
|
+
- lib/torch/nn/nll_loss.rb
|
197
|
+
- lib/torch/nn/pairwise_distance.rb
|
119
198
|
- lib/torch/nn/parameter.rb
|
199
|
+
- lib/torch/nn/poisson_nll_loss.rb
|
200
|
+
- lib/torch/nn/prelu.rb
|
201
|
+
- lib/torch/nn/reflection_pad1d.rb
|
202
|
+
- lib/torch/nn/reflection_pad2d.rb
|
203
|
+
- lib/torch/nn/reflection_padnd.rb
|
120
204
|
- lib/torch/nn/relu.rb
|
205
|
+
- lib/torch/nn/replication_pad1d.rb
|
206
|
+
- lib/torch/nn/replication_pad2d.rb
|
207
|
+
- lib/torch/nn/replication_pad3d.rb
|
208
|
+
- lib/torch/nn/replication_padnd.rb
|
209
|
+
- lib/torch/nn/rnn.rb
|
210
|
+
- lib/torch/nn/rnn_base.rb
|
121
211
|
- lib/torch/nn/sequential.rb
|
212
|
+
- lib/torch/nn/sigmoid.rb
|
213
|
+
- lib/torch/nn/smooth_l1_loss.rb
|
214
|
+
- lib/torch/nn/soft_margin_loss.rb
|
215
|
+
- lib/torch/nn/softmax.rb
|
216
|
+
- lib/torch/nn/softmax2d.rb
|
217
|
+
- lib/torch/nn/softmin.rb
|
218
|
+
- lib/torch/nn/softplus.rb
|
219
|
+
- lib/torch/nn/softshrink.rb
|
220
|
+
- lib/torch/nn/softsign.rb
|
221
|
+
- lib/torch/nn/tanh.rb
|
222
|
+
- lib/torch/nn/tanhshrink.rb
|
223
|
+
- lib/torch/nn/triplet_margin_loss.rb
|
224
|
+
- lib/torch/nn/unfold.rb
|
225
|
+
- lib/torch/nn/utils.rb
|
226
|
+
- lib/torch/nn/weighted_loss.rb
|
227
|
+
- lib/torch/nn/zero_pad2d.rb
|
228
|
+
- lib/torch/optim/adadelta.rb
|
229
|
+
- lib/torch/optim/adagrad.rb
|
230
|
+
- lib/torch/optim/adam.rb
|
231
|
+
- lib/torch/optim/adamax.rb
|
232
|
+
- lib/torch/optim/adamw.rb
|
233
|
+
- lib/torch/optim/asgd.rb
|
234
|
+
- lib/torch/optim/lr_scheduler/lr_scheduler.rb
|
235
|
+
- lib/torch/optim/lr_scheduler/step_lr.rb
|
122
236
|
- lib/torch/optim/optimizer.rb
|
237
|
+
- lib/torch/optim/rmsprop.rb
|
238
|
+
- lib/torch/optim/rprop.rb
|
123
239
|
- lib/torch/optim/sgd.rb
|
240
|
+
- lib/torch/random.rb
|
124
241
|
- lib/torch/tensor.rb
|
125
242
|
- lib/torch/utils/data/data_loader.rb
|
126
243
|
- lib/torch/utils/data/tensor_dataset.rb
|
127
244
|
- lib/torch/version.rb
|
128
245
|
homepage: https://github.com/ankane/torch-rb
|
129
246
|
licenses:
|
130
|
-
-
|
247
|
+
- BSD-3-Clause
|
131
248
|
metadata: {}
|
132
249
|
post_install_message:
|
133
250
|
rdoc_options: []
|
@@ -144,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
261
|
- !ruby/object:Gem::Version
|
145
262
|
version: '0'
|
146
263
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
264
|
+
rubygems_version: 3.1.2
|
148
265
|
signing_key:
|
149
266
|
specification_version: 4
|
150
267
|
summary: Deep learning for Ruby, powered by LibTorch
|