Skip to content

Yiwei-Liao/SBRF

Repository files navigation

Implicit Semantic Communication Based on Bayesian Reconstruction Framework

This document provides instructions for setting up the environment, generating data, and running various tasks related to hypergraph recovery and evaluation using this project.

1. Environment and Prerequisites

1.1. Install Conda Environment

Create and activate the Conda environment. The primary dependency is graph-tool.

conda create --name gt -c conda-forge graph-tool
conda activate gt

1.2. Generate Normal Graph Data

This step generates the necessary graph data. The example below uses the FB-AUTO dataset and valid.txt.

python H2GN.py FB-AUTO valid.txt
  • Replace FB-AUTO with your specific dataset identifier if it differs.
  • Replace valid.txt with your relevant validation or specification file if it differs.

2. Basic Hypergraph Recovery Task

This task performs the fundamental hypergraph recovery process.

2.1. Run Recovery

Execute the main script with the appropriate arguments:

python main.py --dataset_dir dataset/FB-AUTO --input_file FB-AUTO.gt --autostop --save_outputs
  • --dataset_dir dataset/FB-AUTO: Specifies the directory containing the dataset.
  • --input_file FB-AUTO.gt: Specifies the input graph file (e.g., generated by H2GN.py or pre-processed).
  • --autostop: Enables an automatic stopping criterion for the recovery process.
  • --save_outputs: Ensures that the recovered hypergraph data is saved.

2.2. Evaluate Accuracy

To evaluate the accuracy of the recovered hypergraph:

  1. Open the Evaluate.py script in a text editor.

  2. Modify the original_path variable to point to the file containing the original/ground-truth hypergraph.

  3. Modify the recovered_path variable to point to the recovered hypergraph file generated by main.py.

  4. Run the evaluation script:

    python Evaluate.py

    This will output the recovery accuracy.

3. Noise Evaluation

This section describes how to run the hypergraph recovery and evaluation under different noise conditions.

3.1. Run Noise Experiments

Execute the run_all_noise.sh script. This script will likely run the recovery process multiple times with varying noise parameters and save the outputs.

bash run_all_noise.sh

3.2. Evaluate Noise Experiment Results

After run_all_noise.sh completes, you will need to evaluate each generated output:

For each recovered hypergraph file generated by the noise experiments:

  1. Open Evaluate.py.

  2. Ensure original_path is correctly set to the ground-truth hypergraph.

  3. Update recovered_path to point to the specific recovered hypergraph file from the current noise experiment iteration.

  4. Run the evaluation script:

    python Evaluate.py
  5. Repeat steps 2-4 for each output file from the noise experiments.

4. Max Clique Test (Max_L)

This section details how to perform and evaluate the Max Clique (Max_L) based tests.

4.1. Run Max_L Experiments

Execute the run_max_L.sh script. This script will likely run experiments based on different Max_L configurations.

bash run_max_L.sh

4.2. Evaluate Max_L Experiment Results

After run_max_L.sh completes, evaluate each generated output:

For each recovered hypergraph file generated by the Max_L experiments:

  1. Open Evaluate.py.

  2. Ensure original_path is correctly set to the relevant ground-truth hypergraph.

  3. Update recovered_path to point to the specific recovered hypergraph file from the current Max_L experiment iteration.

  4. Run the evaluation script:

    python Evaluate.py
  5. Repeat steps 2-4 for each output file from the Max_L experiments.


Important Notes:

  • Remember to replace placeholder names like FB-AUTO with your actual dataset names if they differ.
  • Ensure all file paths specified in commands or within scripts (dataset_dir, input_file, original_path, recovered_path) are correct relative to your project structure and the outputs of preceding steps.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors