Class: OpenCV::CvANN_MLP
- Inherits:
-
Object
- Object
- OpenCV::CvANN_MLP
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ropencv/ropencv_types.rb
Constants collapse
- IDENTITY =
0
- SIGMOID_SYM =
1
- GAUSSIAN =
2
- UPDATE_WEIGHTS =
1
- NO_INPUT_SCALE =
2
- NO_OUTPUT_SCALE =
4
Class Method Summary collapse
- .cast_from_cv_stat_model(ptr) ⇒ CvANN_MLP (also: castFromCvStatModel)
- .new(*args) ⇒ Object
-
.null ⇒ Object
returns a null pointer to the object.
Instance Method Summary collapse
- #cast_to_cv_stat_model ⇒ CvStatModel (also: #castToCvStatModel)
- #clear ⇒ Void
-
#create(layer_sizes, activate_func = CvANN_MLP::SIGMOID_SYM, _fparam1 = 0, _fparam2 = 0) ⇒ Void
methods.
- #load(filename, name = 0) ⇒ Void
- #predict(inputs, outputs) ⇒ Float
- #save(filename, name = 0) ⇒ Void
-
#to_s ⇒ Object
converts CvANN_MLP into a string by crawling through all its attributes.
- #train(inputs, outputs, sample_weights, sample_idx = Cv::Mat.new(), params = CvANN_MLP_TrainParams.new(), flags = 0) ⇒ Fixnum
Class Method Details
.cast_from_cv_stat_model(ptr) ⇒ CvANN_MLP Also known as: castFromCvStatModel
wrapper for static method CvANN_MLP* CvANN_MLP::castFromCvStatModel(CvStatModel* ptr)
45584 45585 45586 |
# File 'lib/ropencv/ropencv_types.rb', line 45584 def self.cast_from_cv_stat_model(ptr) Rbind::cvann_mlp_cast_from_cv_stat_model(ptr) end |
.cvann_mlp ⇒ Object .cvann_mlp(layer_sizes, activate_func = CvANN_MLP::SIGMOID_SYM, _fparam1 = 0, _fparam2 = 0) ⇒ Object
45413 45414 45415 45416 45417 45418 45419 45420 45421 45422 45423 45424 45425 45426 45427 45428 45429 45430 45431 45432 45433 45434 45435 45436 45437 45438 45439 45440 45441 45442 45443 45444 45445 45446 45447 |
# File 'lib/ropencv/ropencv_types.rb', line 45413 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(CvANN_MLPStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # overloaded method wrapper for CvANN_MLP::CvANN_MLP() @@cvann_mlp_cvann_mlp_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@cvann_mlp_cvann_mlp_defaults0[i] end begin return Rbind::cvann_mlp_cvann_mlp(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for CvANN_MLP::CvANN_MLP(const cv::Mat layerSizes, int activateFunc = CvANN_MLP::SIGMOID_SYM, double fparam1 = 0, double fparam2 = 0) @@cvann_mlp_cvann_mlp2_defaults1 ||= [nil, CvANN_MLP::SIGMOID_SYM, 0, 0] if(args.size >= 1 && args.size <= 4) targs = args.clone targs.size.upto(3) do |i| targs[i] = @@cvann_mlp_cvann_mlp2_defaults1[i] end begin return Rbind::cvann_mlp_cvann_mlp2(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.null ⇒ Object
returns a null pointer to the object
45402 45403 45404 |
# File 'lib/ropencv/ropencv_types.rb', line 45402 def self.null new(CvANN_MLPStruct.new) end |
Instance Method Details
#cast_to_cv_stat_model ⇒ CvStatModel Also known as: castToCvStatModel
method wrapper for CvStatModel* CvANN_MLP::castToCvStatModel()
45570 45571 45572 45573 45574 45575 45576 45577 45578 |
# File 'lib/ropencv/ropencv_types.rb', line 45570 def cast_to_cv_stat_model() __validate_pointer__ result = Rbind::cvann_mlp_cast_to_cv_stat_model( self) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#clear ⇒ Void
method wrapper for void CvANN_MLP::clear()
45563 45564 45565 45566 |
# File 'lib/ropencv/ropencv_types.rb', line 45563 def clear() __validate_pointer__ Rbind::cvann_mlp_clear( self) end |
#create(layer_sizes, activate_func = CvANN_MLP::SIGMOID_SYM, _fparam1 = 0, _fparam2 = 0) ⇒ Void
method wrapper for void CvANN_MLP::create(const cv::Mat layerSizes, int activateFunc = CvANN_MLP::SIGMOID_SYM, double fparam1 = 0, double fparam2 = 0)
methods
45534 45535 45536 45537 |
# File 'lib/ropencv/ropencv_types.rb', line 45534 def create(layer_sizes, activate_func = CvANN_MLP::SIGMOID_SYM, _fparam1 = 0, _fparam2 = 0) __validate_pointer__ Rbind::cvann_mlp_create( self, layer_sizes, activate_func, _fparam1, _fparam2) end |
#load(filename, name = 0) ⇒ Void
method wrapper for void CvANN_MLP::load(c_string filename, c_string name = 0)
45602 45603 45604 45605 |
# File 'lib/ropencv/ropencv_types.rb', line 45602 def load(filename, name = 0) __validate_pointer__ Rbind::cvann_mlp_load( self, filename, name) end |
#predict(inputs, outputs) ⇒ Float
method wrapper for float CvANN_MLP::predict(const cv::Mat inputs, cv::Mat& outputs)
45556 45557 45558 45559 |
# File 'lib/ropencv/ropencv_types.rb', line 45556 def predict(inputs, outputs) __validate_pointer__ Rbind::cvann_mlp_predict( self, inputs, outputs) end |
#save(filename, name = 0) ⇒ Void
method wrapper for void CvANN_MLP::save(c_string filename, c_string name = 0)
45593 45594 45595 45596 |
# File 'lib/ropencv/ropencv_types.rb', line 45593 def save(filename, name = 0) __validate_pointer__ Rbind::cvann_mlp_save( self, filename, name) end |
#to_s ⇒ Object
converts CvANN_MLP into a string by crawling through all its attributes
45513 45514 45515 |
# File 'lib/ropencv/ropencv_types.rb', line 45513 def to_s "#<CvANN_MLP >" end |
#train(inputs, outputs, sample_weights, sample_idx = Cv::Mat.new(), params = CvANN_MLP_TrainParams.new(), flags = 0) ⇒ Fixnum
method wrapper for int CvANN_MLP::train(const cv::Mat inputs, const cv::Mat outputs, const cv::Mat sampleWeights, const cv::Mat sampleIdx = cv::Mat(), const CvANN_MLP_TrainParams params = CvANN_MLP_TrainParams(), int flags = 0)
45547 45548 45549 45550 |
# File 'lib/ropencv/ropencv_types.rb', line 45547 def train(inputs, outputs, sample_weights, sample_idx = Cv::Mat.new(), params = CvANN_MLP_TrainParams.new(), flags = 0) __validate_pointer__ Rbind::cvann_mlp_train( self, inputs, outputs, sample_weights, sample_idx, params, flags) end |