Jump to content

Search the Community

Showing results for tags 'machine learning'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Development
    • HTML Coding
    • JavaScript
    • PHP
    • CMS
    • Database
    • Web Server
    • Web-site Development
    • Internet Marketing, SEO
  • Library
    • Tricks and solutions
    • Books
  • Commercial services
    • Freelance
    • Job
    • Goods and Services
  • Our Forum
    • Flame
    • Contests
    • Feedback and Ideas

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Web site


Telegram


Signal


Viber


Skype


From


Interests

Found 1 result

  1. Здравствуйте, мне нужно чтобы сеть различала есть на изображении предмет или нету Вот код на обучение: $j = 0; $my_example = array(); for ( $i = 0; $i < 2; $i++ ) { $d = dir("resize/$i"); while($entry = $d->read()) { if ( preg_match("/jpg/", $entry) ) { $im = imagecreatefromjpeg("black/$i/$entry"); $cur_array = array(); $cnt = 0; for($y=0; $y<300; $y++) { for($x=0; $x < 500; $x++) { $rgb = imagecolorat($im, $x, $y) / 16777215; $cur_array[$cnt] = $rgb; $cnt++; } } imagedestroy($im); $my_example[$j] = array($cur_array, array($i)); $j++; } } } $num_input = 150000; $num_output = 1; $num_layers = 3; $num_neurons_hidden = 100; $desired_error = 0.000001; $max_epochs = 5000000; $epochs_between_reports = 10; $ocr_ann = fann_create_standard($num_layers, $num_input, $num_neurons_hidden, $num_output); if ($ocr_ann) { echo 'Training OCR... '; fann_set_activation_function_hidden($ocr_ann, FANN_SIGMOID_SYMMETRIC); fann_set_activation_function_output($ocr_ann, FANN_SIGMOID_SYMMETRIC); for ($i = 1; $i <= 150000; $i++) { $input[] = $i; } $desired_output = array( 1 ); var_dump( fann_train( $ocr_ann, $input, $desired_output ) ); fann_save($ocr_ann, dirname(__FILE__) . "/ocr_float3.net"); } а вот на проверку: echo "Hello!"; $j = 0; $my_example = array(); $im = imagecreatefromjpeg("black/0/1.jpg"); $cur_array = array(); $cnt = 0; for($y=0; $y<300; $y++) { for($x=0; $x < 500; $x++) { $rgb = imagecolorat($im, $x, $y) / 16777215; $cur_array[$cnt] = $rgb; $cnt++; } } imagedestroy($im); echo "Hello!"; $train_file = (dirname(__FILE__) . '/ocr_float3.net'); $ocr_ann = fann_create_from_file($train_file); $calc_out = fann_run($ocr_ann, $cur_array); echo "Hello!"; var_dump($calc_out); По моей логике, если есть предмет то результат стремится к единице, а если нету то к нулю Но результат совсем не такой, как ожидал. Подскажите пожалуйста, что не так в коде?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy