任何人都可以帮我解决错误吗?
Update table
SET
tentative = case src.tentative
WHEN 1 THEN 't' ELSE 'f' END
FROM table
答案 0 :(得分:4)
您的专栏BOOLEAN
是TEXT
类型;但是,您尝试使用BOOLEAN
类型值更新它。
您需要做的就是在更新中使用UPDATE table
SET tentative = CASE src.tentative WHEN 1 THEN TRUE ELSE FALSE END
FROM src_table src;
,如下所示:
UPDATE table
SET tentative = (src.tentative = 1)
FROM src_table src;
或者,但也许不太明显,你可以这样做:
require 'cerebrum'
input = Array.new
300.times do |i|
inputH = Hash.new
inputH[:input]=[i]
sinus = Math::sin(i)
inputH[:output] = [sinus]
input.push(inputH)
end
network = Cerebrum.new
network.train(input, {
error_threshold: 0.00005,
iterations: 40000,
log: true,
log_period: 1000,
learning_rate: 0.3
})
res = Array.new
300.times do |i|
result = network.run([i])
res.push(result[0])
end
puts "#{res}"