Skip to content

Commit

Permalink
update examples for Google Colab.
Browse files Browse the repository at this point in the history
Signed-off-by: The Sionna Team <[email protected]>
Merged-by: Guillermo Marcus <[email protected]>

Co-authored-by: Jakob Hoydis <[email protected]>
Co-authored-by: Fayçal Ait-Aoudia <[email protected]>
Co-authored-by: Sebastian Cammerer <[email protected]>
Co-authored-by: Guillermo Marcus <[email protected]>
Co-authored-by: Merlin Nimier-David <[email protected]>
Co-authored-by: Lorenzo Maggi <[email protected]>
  • Loading branch information
7 people committed Oct 1, 2024
1 parent a8dc169 commit cd80510
Show file tree
Hide file tree
Showing 78 changed files with 732 additions and 735 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"import tensorflow as tf\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
Expand All @@ -86,15 +95,6 @@
"# Avoid warnings from TensorFlow\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Set random seed for reproducibility\n",
"sionna.config.seed = 42\n",
"\n",
Expand Down
18 changes: 9 additions & 9 deletions docs/_sources/examples/5G_NR_PUSCH.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"import tensorflow as tf\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
Expand All @@ -72,15 +81,6 @@
"# Avoid warnings from TensorFlow\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"sionna.config.seed = 42 # Set seed for reproducible results\n",
"\n",
"# Load the required Sionna components\n",
Expand Down
18 changes: 9 additions & 9 deletions docs/_sources/examples/Autoencoder.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
"import tensorflow as tf\n",
Expand All @@ -100,15 +109,6 @@
"from tensorflow.keras import Model\n",
"from tensorflow.keras.layers import Layer, Dense\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"from sionna.channel import AWGN\n",
"from sionna.utils import BinarySource, ebnodb2no, log10, expand_to_rank, insert_dims\n",
"from sionna.fec.ldpc.encoding import LDPC5GEncoder\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
"import tensorflow as tf\n",
Expand All @@ -95,15 +104,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Load the required Sionna components\n",
"from sionna.mapping import Constellation, Mapper, Demapper\n",
"from sionna.fec.ldpc import LDPC5GEncoder, LDPC5GDecoder, LDPCBPDecoder\n",
Expand Down
19 changes: 9 additions & 10 deletions docs/_sources/examples/CIR_Dataset.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
"import tensorflow as tf\n",
Expand All @@ -61,16 +70,6 @@
"# Avoid warnings from TensorFlow\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"import numpy as np\n",
"import h5py\n",
"\n",
Expand Down
18 changes: 9 additions & 9 deletions docs/_sources/examples/DeepMIMO.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
"import tensorflow as tf\n",
Expand All @@ -61,15 +70,6 @@
"# Avoid warnings from TensorFlow\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"sionna.config.seed = 42 # Set seed for reproducible random number generation"
]
},
Expand Down
18 changes: 9 additions & 9 deletions docs/_sources/examples/Evolution_of_FEC.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
"import tensorflow as tf\n",
Expand All @@ -63,15 +72,6 @@
"# Avoid warnings from TensorFlow\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"sionna.config.seed = 42 # Set seed for reproducible random number generation\n",
"\n",
"# Load the required Sionna components\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"import tensorflow as tf\n",
"from tensorflow.keras import Model\n",
"gpus = tf.config.list_physical_devices('GPU')\n",
Expand All @@ -107,15 +116,6 @@
"# Avoid warnings from TensorFlow\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
"import tensorflow as tf\n",
Expand All @@ -116,15 +125,6 @@
" print(e)\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Set random seed for reproducibility\n",
"sionna.config.seed = 42"
]
Expand Down
18 changes: 9 additions & 9 deletions docs/_sources/examples/Neural_Receiver.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
"import tensorflow as tf\n",
Expand All @@ -100,15 +109,6 @@
"# Avoid warnings from TensorFlow\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"sionna.config.seed = 42 # Set seed for reproducible random number generation"
]
},
Expand Down
18 changes: 9 additions & 9 deletions docs/_sources/examples/OFDM_MIMO_Detection.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
"import tensorflow as tf\n",
Expand All @@ -133,15 +142,6 @@
"# Avoid warnings from TensorFlow\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"sionna.config.seed = 42 # Set seed for reproducible random number generation"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@
" os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"import tensorflow as tf\n",
"# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n",
"# For more details, see https://www.tensorflow.org/guide/gpu\n",
Expand All @@ -103,15 +112,6 @@
"# Avoid warnings from TensorFlow\n",
"tf.get_logger().setLevel('ERROR')\n",
"\n",
"# Import Sionna\n",
"try:\n",
" import sionna\n",
"except ImportError as e:\n",
" # Install Sionna if package is not already installed\n",
" import os\n",
" os.system(\"pip install sionna\")\n",
" import sionna\n",
"\n",
"# Set random seed for reproducibility\n",
"sionna.config.seed = 42\n",
"from sionna.channel import utils\n",
Expand Down Expand Up @@ -1360,7 +1360,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.4"
},
"vscode": {
"interpreter": {
Expand Down
Loading

0 comments on commit cd80510

Please sign in to comment.