Skip to main content

社会熵扩散优化算法(SEDO) / Social Entropy Diffusion Optimizer (SEDO)

[English] | [中文] | [开发文档]

Python Version License: MIT

受社会学与量子物理启发的创新型全局优化算法

算法特点

  • 🌐 文化空间信息传播模型
  • ⚛️ 量子化粒子表示
  • 🔥 基于熵流的探索-开发平衡
  • 🎯 支持单目标/多目标优化
  • ⚡ 并行计算加速

安装方法

pip install sedo

快速开始

不要使用 lambda 函数作为目标函数!

from sedo import SEDOptimizer

# 定义目标函数
def rastrigin(x):
    return 10*len(x) + sum(x**2 - 10*np.cos(2*np.pi*x))

# 初始化优化器
optimizer = SEDOptimizer(
    objective_func=rastrigin,
    problem_dim=20,
    n_particles=50
)

# 执行优化
optimizer.optimize(max_iter=200)

# 获取结果
best_solution = optimizer.get_best_solution()
print(f"最优解: {best_solution}")

对比测试结果

函数 算法 平均适应度 标准差
Sphere SEDO 0.105087 0.057231
Sphere PSO 0.097989 0.080966
Rosenbrock SEDO -25124.000000 531.337934
Rosenbrock PSO -24136.000000 1778.088862
Ackley SEDO 1.739894 0.821921
Ackley PSO 2.284575 0.898855

高级特性

文化传播可视化

from sedo.utils import plot_cultural_diffusion
plot_cultural_diffusion(optimizer.particles)

参数敏感性分析

from sedo.utils import parameter_sensitivity
results = parameter_sensitivity(
    objective_func,
    param_ranges={
        'barrier_height': (0.1, 1.0),
        'entropy_threshold': (0.3, 0.9)
    }
)

应用案例

  1. 神经网络超参数优化
optimizer = SEDOptimizer(
    objective_func=neural_net_train,
    problem_dim=8,
    bounds=[(32,512), (0.0001,0.1), ...]  # 各参数范围
)
  1. 投资组合优化
optimizer = SEDOptimizer(
    objective_func=portfolio_eval,
    problem_dim=10,
    multi_objective=True  # 同时优化收益和风险
)

参与贡献

欢迎提交Issue和Pull Request!

  1. Fork项目
  2. 创建特性分支 (git checkout -b feature/your-feature)
  3. 提交更改 (git commit -am 'Add some feature')
  4. 推送分支 (git push origin feature/your-feature)
  5. 新建Pull Request

许可证

MIT License

Social Entropy Diffusion Optimizer (SEDO)

[English] | [中文] | [Development Documentation]

An innovative global optimization algorithm inspired by sociology and quantum physics

Key Features

  • 🌐 Cultural space information diffusion model
  • ⚛️ Quantum particle representation
  • 🔥 Exploration-exploitation balance based on entropy flow
  • 🎯 Single/Multi-objective optimization support
  • ⚡ Parallel computing acceleration

Installation

pip install sedo

Quick Start

Do Not USE lambda function as objective function!

from sedo import SEDOptimizer

# Define objective function
def rastrigin(x):
    return 10*len(x) + sum(x**2 - 10*np.cos(2*np.pi*x))

# Initialize optimizer
optimizer = SEDOptimizer(
    objective_func=rastrigin,
    problem_dim=20,
    n_particles=50
)

# Run optimization
optimizer.optimize(max_iter=200)

# Get results
best_solution = optimizer.get_best_solution()
print(f"Optimal solution: {best_solution}")

Comparative Test Results

Function Algorithm Avg Fitness Std Dev
Sphere SEDO 0.105087 0.057231
Sphere PSO 0.097989 0.080966
Rosenbrock SEDO -25124.000000 531.337934
Rosenbrock PSO -24136.000000 1778.088862
Ackley SEDO 1.739894 0.821921
Ackley PSO 2.284575 0.898855

Advanced Features

Cultural Diffusion Visualization

from sedo.utils import plot_cultural_diffusion
plot_cultural_diffusion(optimizer.particles)

Parameter Sensitivity Analysis

from sedo.utils import parameter_sensitivity
results = parameter_sensitivity(
    objective_func,
    param_ranges={
        'barrier_height': (0.1, 1.0),
        'entropy_threshold': (0.3, 0.9)
    }
)

Application Examples

  1. Neural Network Hyperparameter Tuning
optimizer = SEDOptimizer(
    objective_func=neural_net_train,
    problem_dim=8,
    bounds=[(32,512), (0.0001,0.1), ...]  # Parameter ranges
)
  1. Portfolio Optimization
optimizer = SEDOptimizer(
    objective_func=portfolio_eval,
    problem_dim=10,
    multi_objective=True  # Optimize return and risk simultaneously
)

How to Contribute

We welcome issues and pull requests!

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Create a new Pull Request

License

MIT License

Back to Top

Metadata

Release files for sedo 1.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sedo 1.2.5
File Size Uploaded
sedo-1.2.5.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sedo 1.2.5
File Interpreter ABI Platform
sedo-1.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 27.0 kB

Release files / sedo-1.2.5.tar.gz

Download URL sedo-1.2.5.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
56995b9735300f137042256a097f3f3d680fbe1bc1ac32652460948e3f708a94
BLAKE2b-256 checksum
How to use checksums
db4ff5719dd05168286ca17bf0fe891d7af1197db367c819b500f8db90e91614
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / sedo-1.2.5-py3-none-any.whl

Download URL sedo-1.2.5-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f4efca1b3b3f3c14467fe319f441d56d12ae2176eaaa2599d35630bdf3415f0
BLAKE2b-256 checksum
How to use checksums
974c4e5f710f604424066a15ab60109a28074f03683be08692716427725ec76d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release history Release notifications | RSS feed

This release

1.2.5 This release

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.5

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page