agentsclimarketplace

Feedforward neural network architecture design

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/feedforward-neural-network-architecture-design

Use when you have preprocessed molecular structures as fixed-length feature vectors and need to establish a fair-comparison baseline model for tandem mass spectrum prediction.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill feedforward-neural-network-architecture-design

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

8.2 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

feedforward-neural-network-architecture-design

Summary

Design and implement a feedforward neural network (FFN) encoder to convert fixed-length molecular feature vectors into spectrum predictions, using standardized hyperparameter sweeps and loss functions for fair comparison with alternative spectrum prediction models. This skill enables equivalent-setting baseline implementation within comparative mass spectrometry prediction frameworks.

When to use

You have preprocessed molecular structures as fixed-length feature vectors and need to establish a fair-comparison baseline model for tandem mass spectrum prediction. Use this skill when you must compare spectrum prediction models under identical covariates and hyperparameter sweep ranges—particularly when validating whether graph-based or more complex encoders outperform simpler feedforward approaches on the same benchmark dataset (e.g., NIST'20 or MassSpecGym).

When NOT to use

  • Input is already a pretrained foundation model (e.g., MolBERT, ChemBERTa embeddings)—use transfer learning or fine-tuning instead.
  • Molecular structures are available only as 3D conformations or graph representations requiring inductive bias—use graph neural networks (GNN) or 3D convolutions instead.
  • Spectrum predictions must reflect fragmentation mechanisms (breakage events, substructure transitions)—use mechanistic models like ICEBERG with fragment generators instead.

Inputs

  • fixed-length molecular feature vectors (e.g., fingerprints, descriptor arrays)
  • preprocessed molecular structures from benchmark dataset (NIST'20 or MassSpecGym)
  • corresponding ground-truth tandem mass spectra (in .mgf, .msp, or .hdf5 format)
  • hyperparameter sweep configuration (learning rate, batch size, hidden layer sizes, epochs)

Outputs

  • trained FFN encoder checkpoint (PyTorch .pt or TensorFlow .h5 format)
  • spectrum predictions on test set (predicted m/z intensities aligned to ground truth)
  • evaluation metrics (cosine similarity scores, spectral match scores per compound)
  • comparison results versus alternative encoders (NEIMS GNN, MassFormer, etc.) under identical settings

How to apply

First, preprocess molecular structures into fixed-length feature vectors compatible with FFN input (e.g., molecular fingerprints or descriptor arrays). Construct a feedforward architecture with stacked hidden layers and ReLU activations, ensuring layer sizes are swept over during hyperparameter optimization. Train using mean squared error (MSE) loss with Adam optimizer, applying the same hyperparameter sweep ranges to all compared models (NEIMS FFN, NEIMS GNN, MassFormer, 3DMolMS, GrAFF-MS) to ensure equivalent settings. Evaluate on held-out test sets using spectrum-specific metrics (cosine similarity, spectral match score) rather than raw MSE alone. Save trained checkpoints and generate predictions on benchmark compounds to enable direct comparison with ms-pred results. Document the exact architecture (layer sizes, activation functions, dropout if used) and hyperparameter ranges to enable reproducibility.

Related tools

  • PyTorch (primary framework for implementing FFN encoder with standard layers (nn.Linear, nn.ReLU) and training via MSE loss)
  • TensorFlow (alternative framework for FFN construction and training equivalent to PyTorch implementation)
  • ms-pred (benchmark framework providing equivalent hyperparameter sweep infrastructure, NIST'20 and MassSpecGym datasets, and comparative baseline implementations) — github.com/samgoldman97/ms-pred
  • Adam optimizer (standard optimization algorithm for FFN training on spectrum prediction task)

Evaluation signals

  • Cosine similarity between predicted and ground-truth spectra is ≥ 0.7 on test compounds (spectrum-level metric, not per-ion)
  • Spectral match scores (e.g., MS-DIAL or GNPS scoring) exceed baseline thresholds for true positives in retrieval experiments
  • FFN performance is statistically comparable to or significantly outperformed by GNN variants (NEIMS GNN, GrAFF-MS) trained under identical settings, validating that added encoder complexity provides measurable benefit
  • Hyperparameter sweep produces reproducible ranking of layer sizes and learning rates across data splits (e.g., split_1_rnd1, split_2_rnd2, split_3_rnd3)
  • Model checkpoint loads without error and inference on held-out test set completes without NaN or inf predictions

Limitations

  • FFN encoders cannot directly exploit molecular graph structure or 3D spatial relationships, limiting their ability to capture fragmentation patterns tied to specific bond breaks or ring rearrangements—use graph or 3D models for mechanistic insight.
  • Fixed-length input vectors lose fine-grained structural information; feature engineering quality directly impacts performance, and suboptimal descriptors may penalize FFN unfairly versus methods that learn structural representations end-to-end.
  • NIST'20 dataset requires commercial purchase and has license restrictions; reproducibility and public availability are limited unless using openly available MassSpecGym, which has undergone less manual curation and quality control.
  • Hyperparameter sweep must match all compared models exactly (same learning rates, batch sizes, epoch counts) to ensure fair comparison; any deviation breaks equivalence-of-settings assumption and may confound results.

Evidence

  • [other] FFN encoder enables equivalent-setting baseline for spectrum prediction models: "implement a number of baselines and alternative models using equivalent settings across models (i.e., same covariates, hyperparameter sweeps for each, etc.)"
  • [other] Preprocess molecular structures into fixed-length feature vectors suitable for FFN input: "Preprocess molecular structures into fixed-length feature vectors suitable for FFN input."
  • [other] Construct FFN with standard hidden layers and ReLU activations for spectrum prediction: "Construct a feedforward neural network encoder with standard hidden layers and ReLU activations."
  • [other] Train FFN using MSE loss and Adam optimizer on spectrum prediction task: "Train the FFN encoder on the spectrum prediction task using mean squared error loss and an optimization algorithm (e.g. Adam)."
  • [other] Evaluate using spectrum-specific metrics rather than raw loss alone: "Evaluate the model on a held-out test set, computing prediction accuracy metrics (e.g. cosine similarity, spectral match score)."
  • [readme] NIST'20 dataset quality and licensing context: "NIST'20 is the only database where all spectra have collision energy annotations, this dataset is a reasonable investment in mass spectrum-related research in the absence of a thorough open-source"
  • [readme] MassSpecGym alternative with less curation quality: "MassSpecGym has undergone less manual curation and quality control compared to NIST, and the results of new predictions will be different."

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,852. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.