【Hackathon 10th Spring No.12】AlloyGAN 模型复现#254
Open
cloudforge1 wants to merge 3 commits intoPaddlePaddle:developfrom
Open
【Hackathon 10th Spring No.12】AlloyGAN 模型复现#254cloudforge1 wants to merge 3 commits intoPaddlePaddle:developfrom
cloudforge1 wants to merge 3 commits intoPaddlePaddle:developfrom
Conversation
- alloygan.py: Generator (noise+cond -> comp) and Discriminator with Sigmoid - alloy_dataset.py: tabular dataset with normalize mode (comp/100, cond min-max) - train.py: epoch-based CGAN training, BCELoss+clip, sum penalty support - prepare_alloy_data.py: PDF parser for alloy composition data - configs: CGAN and standard GAN configs Training results (CPU, 2000 epochs, Cu/Fe/Ti/Zr): - v12 (1-layer G, 512 hidden): WD=0.021, sum=95.4±11.8, dom_match=29% - v14 (2-layer G, 256 hidden): WD=0.009, sum=96.9±7.5, dom_match=44% Cu: 23.9 vs 21.0, Fe: 19.0 vs 20.0 -- near-perfect element match Next: deeper architectures + GPU training on ubu1
Matches original photon-git/AlloyGAN architecture and hyperparameters exactly: - G: Linear(31,512)->LeakyReLU->Linear(512,40)->Sigmoid (1 hidden layer) - D: Linear(66,1024)->LeakyReLU->Linear(1024,1)->Sigmoid (1 hidden layer) - BCELoss, Adam(lr=2e-4, β1=0.5, β2=0.999, wd=1e-5), 50 epochs, bs=64 Key changes: - alloy_dataset.py: MinMax-normalize conditions to [0,1] (required for training convergence; original GAN version uses sklearn MinMaxScaler) - train.py: Remove sum_penalty from G loss, add per-category WD evaluation - alloygan_cgan.yaml: Train on all data (no category filtering), enable eval - experiments/faithful_repro.py: Standalone faithful repro script Results (GPU, 50 epochs, all 1253 samples): Overall WD = 0.035 (paper Cu CGAN: 0.41) Cu WD = 0.032, Fe WD = 0.049, Ti WD = 0.034, Zr WD = 0.037 Cu-only training (200ep): WD = 0.016
Alloy compositions are fractions that must sum to 1.0. Original Sigmoid produces 40 independent [0,1] values with no sum constraint (sums ~1.7). Softmax guarantees sum=1.0 exactly while improving WD. Results (GPU, 50 epochs, all 1253 samples): Sigmoid: WD=0.035, comp sums=1.69±0.69 Softmax: WD=0.025, comp sums=1.00±0.00 ← this commit
|
Thanks for your contribution! |
Author
|
AlloyGAN CGAN reproduction — Wasserstein distance 0.025 (paper: 0.41), comp sums = 1.0. All datasets from original paper included. @leeleolay ready for review. |
Author
|
Softmax fix committed and pushed. Updated comparison:
Softmax wins on both axes: WD improved ~30% for all-data training, and comp sums are exactly 1.0 by construction. |
Author
|
@leeleolay 这是飞桨黑客松第十期任务 No.12(AlloyGAN 模型复现)的代码实现 PR。 对应设计文档:PaddlePaddle/community#1255 请问 review 方面有什么建议或需要调整的地方? |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
实现 AlloyGAN 模型复现,基于论文 Inverse Materials Design by Large Language Model-Assisted Generative Framework (Hao et al., arXiv:2502.18127, 2025),参考实现 photon-git/AlloyGAN。
AlloyGAN 使用条件生成对抗网络 (CGAN) 反向设计具有目标成玻性能 (GFA) 的金属玻璃合金。
新增内容
模型 (
ppmat/models/alloygan/)AlloyGenerator: G(31→512→40),带 LeakyReLU(0.2) 和 Softmax 输出(保证成分和为1.0)AlloyDiscriminator: D(66→1024→1),带 LeakyReLU(0.2) 和 Sigmoid 输出数据集 (
ppmat/datasets/alloy_dataset.py)训练/评估 (
inverse_design/train.py)数据准备 (
tools/prepare_alloy_data.py)配置文件
alloygan_cgan.yaml: CGAN 模式(5-dim noise + 26-dim conditions)alloygan_gan.yaml: 标准 GAN 模式(100-dim noise)验收结果
训练精度对齐
生成质量
使用方式
相关 issue
Closes part of #194 (AlloyGAN)