Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Integer precision issues #174

Closed
Closed
Labels
enhancementNew feature or request
@huku-

Description

@huku-

Passinggene_type=int in theGA class constructor, will result in internalnumpy arrays holding 64-bit integer values. This is well known to numpy users:

>>> type(numpy.array([1], dtype=int)[0])<class 'numpy.int64'>

This, however, has two major problems:

  1. It contradicts the fact that Pythonints are arbitrary precision integers
  2. It prohibits users from usingpygad to explore bigger state-spaces (e.g. bit-vectors of 256-bits, or even larger in my case)

To solve this problem, a one-liner fix is to addobject inGA.supported_int_typeshere. Then, users can passgene_type=object in theGA constructor and handle Python integers in objective functions without worrying aboutnumpy getting in their way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp