Skip to content

Add GPU Handling in neural network Model Base Class  #21

@benlyazid

Description

@benlyazid

Currently, GPU usage is not explicitly handled in the model base class.
To provide better flexibility, we should introduce a mechanism to switch between NumPy and CuPy based on user preference.

Proposed Solution:

  • Convert np into a class attribute in the model base class.
  • If the user wants to use the GPU, set np to CuPy (cupy).
  • Otherwise, default to NumPy (numpy).

This change will allow seamless switching between CPU and GPU computations without modifying other parts of the code.

Additional Context:
This approach will improve performance for users who want GPU acceleration while maintaining compatibility for CPU-only environments.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions