module TLearn
Constants
- VERSION
Public Class Methods
add_noise_data(data,noise_rate)
click to toggle source
add noise to sample datas¶ ↑
@param data Array data which we want to add noise @param noise_rate float rate of noise
# File lib/t_learn/hop_field_net.rb, line 103 def TLearn.add_noise_data(data,noise_rate) data_with_noise = Marshal.load(Marshal.dump(data)) data.size.times do |n| if rand <= noise_rate if data_with_noise[n] == -1.0 data_with_noise[n] = 1.0 else data_with_noise[n] = -1.0 end end end return data_with_noise end
evaluate(teacher_data,data)
click to toggle source