Group
Extension

Matches 2

Net-MachineLearning-Sample ( Y/YH/YHPENG/Net-MachineLearning-Sample-0.01.tgz, YHPENG, 2017; MetaCPAN )
Net-MachineLearning-Sample/lib/Net/MachineLearning/Sample.pm ( view source; MetaCPAN )
package Net::MachineLearning::Sample;

use 5.006;
use strict;
use warnings;
use utf8;
use JSON;
use GD;

=encoding utf8

=head1 NAME

Net::MachineLearning::Sample - how machine learning works by demo
的相似概率,数字越大相似度越高。

权重参数是一个JSON文件,位于库文件同一目录下的weights.json,通过get_weights.pl这个脚本产生。

正常来说,权重参
0);
    my %scores;

    open my $fd,"$module_dir/weights.json" or die $!;
    my $json = <$fd>;
    close $fd;

    my $wht = from_json($json);

    my $myImage = newFromPng GD::Image("$module_dir/gr
Net-MachineLearning-Sample ( Y/YH/YHPENG/Net-MachineLearning-Sample-0.01.tgz, YHPENG, 2017; MetaCPAN )
Net-MachineLearning-Sample/lib/Net/MachineLearning/get_weights.pl ( view source; MetaCPAN )
use strict;
use JSON;
use GD;

my %wht;
for my $ix (0..9) {
    my $myImage = newFromPng GD::Image("gray-$ix.png",0);
    my @weights;

    # 10x10 image
    for my $column (0..9) {
    	for my $row (
		my $weight = 255 - $index;
    		push @weights,$weight;
        }
    }
	$wht{$ix} = [@weights];
}

my $json = to_json(\%wht);

open my $fd,">","weights.json" or die $!;
print $fd $json;
close $fd;

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.