Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • bob bob
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • bobbob
  • bobbob
  • Issues
  • #132
Closed
Open
Issue created May 28, 2013 by André Anjos@andre.anjos💬Owner

KmeansTrainer never stops if it reaches 0 on the first iteration

Created by: anjos

The following code sample (color image segmentation) shows the problem:

import bob
import logging

image = bob.io.load('/idiap/resource/database/banca/english/images/en_video_sc1_1/1001_f_g1_s01_1001_en_1.ppm')
image_flat = image.reshape(3, -1).transpose().copy()
logging.getLogger().setLevel(logging.INFO)
kmeans = bob.machine.KMeansMachine(3, 3)
ktrainer = bob.trainer.KMeansTrainer()
ktrainer.max_iterations = 1000
ktrainer.convergence_threshold = 1e-5
ktrainer.train(kmeans, image_flat)

This code will iterate 1000 times instead of stopping on the very first iteration as expected.

Assignee
Assign to
Time tracking