Skip to content

Commit

Permalink
rename underscore to hyphen in dir names
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenMuyuan committed Sep 6, 2023
1 parent 48a97e2 commit 17501e6
Show file tree
Hide file tree
Showing 47 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions docs/benchmarking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ this dependency no longer exists and the code needs substantial changes.

## 3. Pure C++ vs. C++-Python interface

The benchmark is based on the [pure C++ (libtorch)](../../examples/rl-tcp/pure_cpp) and
[message interface (PyTorch)](../../examples/rl-tcp/use_msg) version of RL-TCP example.
The benchmark is based on the [pure C++ (libtorch)](../../examples/rl-tcp/pure-cpp) and
[message interface (PyTorch)](../../examples/rl-tcp/use-msg) version of RL-TCP example.
We compare the processing time (i.e. transmission time + DRL algorithm time
for message interface, DRL algorithm time for pure C++) for the two interfaces,
including the mean and the standard deviation. The difference can be considered
Expand Down
6 changes: 3 additions & 3 deletions docs/using-pure-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ is [in progress and incomplete](https://github.com/tensorflow/docs/blob/master/s
As a result, the [LTE-CQI](../examples/lte-cqi) example, which uses LSTM and requires Gradients and
Neural Network library, cannot be rewritten into pure C++ version using `libtensorflow`.

However, a [basic example](../examples/lte-cqi/pure_cpp) is provided for checking whether
However, a [basic example](../examples/lte-cqi/pure-cpp) is provided for checking whether
`libtensorflow` is correctly installed. If it is, `./ns3 run ns3ai_ltecqi_purecpp`
should successfully print TensorFlow's version. The full example using LSTM will be
available when TensorFlow offers sufficient C API to developers.
Expand Down Expand Up @@ -109,8 +109,8 @@ symbols like `_PyBaseObject_Type` are missing.

- Cmake target: `ns3ai_rltcp_purecpp`

The [message-interface version of the RL-TCP example](../examples/rl-tcp/use_msg)
has been [modified](../examples/rl-tcp/pure_cpp) to run in pure C++, utilizing PyTorch C++ APIs. All RL
The [message-interface version of the RL-TCP example](../examples/rl-tcp/use-msg)
has been [modified](../examples/rl-tcp/pure-cpp) to run in pure C++, utilizing PyTorch C++ APIs. All RL
functionalities are same with original, except for random seed settings that can
lead to different results. Running `ns3ai_rltcp_purecpp` should by
default apply deep Q-learning algorithm (DQN) to choose TCP parameters, with states
Expand Down
14 changes: 7 additions & 7 deletions examples/a-plus-b/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
build_lib_example(
NAME ns3ai_apb_msg_vec
SOURCE_FILES use_msg_vec/apb.cc
SOURCE_FILES use-msg-vec/apb.cc
LIBRARIES_TO_LINK ${libai}
)
pybind11_add_module(ns3ai_apb_py_vec use_msg_vec/apb_py.cc)
pybind11_add_module(ns3ai_apb_py_vec use-msg-vec/apb_py.cc)
set_target_properties(ns3ai_apb_py_vec PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/use_msg_vec)
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/use-msg-vec)

build_lib_example(
NAME ns3ai_apb_msg_stru
SOURCE_FILES use_msg_stru/apb.cc
SOURCE_FILES use-msg-stru/apb.cc
LIBRARIES_TO_LINK ${libai}
)
pybind11_add_module(ns3ai_apb_py_stru use_msg_stru/apb_py.cc)
pybind11_add_module(ns3ai_apb_py_stru use-msg-stru/apb_py.cc)
set_target_properties(ns3ai_apb_py_stru PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/use_msg_stru)
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/use-msg-stru)

# Build Python binding library along with C++ library
add_dependencies(ns3ai_apb_msg_vec ns3ai_apb_py_vec)
add_dependencies(ns3ai_apb_msg_stru ns3ai_apb_py_stru)

build_lib_example(
NAME ns3ai_apb_gym
SOURCE_FILES use_gym/apb.cc
SOURCE_FILES use-gym/apb.cc
LIBRARIES_TO_LINK ${libai} ${libcore}
)
6 changes: 3 additions & 3 deletions examples/a-plus-b/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cd YOUR_NS3_DIRECTORY
3. Run Python script

```bash
cd contrib/ai/examples/a-plus-b/use_gym
cd contrib/ai/examples/a-plus-b/use-gym
python apb.py
```

Expand All @@ -49,7 +49,7 @@ cd YOUR_NS3_DIRECTORY
3. Run Python script

```bash
cd contrib/ai/examples/a-plus-b/use_msg_stru
cd contrib/ai/examples/a-plus-b/use-msg-stru
python apb.py
```

Expand All @@ -66,7 +66,7 @@ cd YOUR_NS3_DIRECTORY
3. Run Python script

```bash
cd contrib/ai/examples/a-plus-b/use_msg_vec
cd contrib/ai/examples/a-plus-b/use-msg-vec
python apb.py
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions examples/lte-cqi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
build_lib_example(
NAME ns3ai_ltecqi_msg
SOURCE_FILES
use_msg/lte_cqi.cc
use_msg/cqi-dl-env.cc
use_msg/my-rr-sched.cc
use-msg/lte_cqi.cc
use-msg/cqi-dl-env.cc
use-msg/my-rr-sched.cc
LIBRARIES_TO_LINK
${libai}
${libcore}
Expand All @@ -17,9 +17,9 @@ build_lib_example(
${liblte}
)

pybind11_add_module(ns3ai_ltecqi_py use_msg/lte_cqi_py.cc)
pybind11_add_module(ns3ai_ltecqi_py use-msg/lte_cqi_py.cc)
set_target_properties(ns3ai_ltecqi_py PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/use_msg/)
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/use-msg/)
target_link_libraries(ns3ai_ltecqi_py PRIVATE ${libai})

# Build Python interface along with C++ lib
Expand All @@ -30,7 +30,7 @@ if(NS3AI_LIBTENSORFLOW_EXAMPLES)
message(STATUS "LTE-CQI pure C++ example enabled")
build_lib_example(
NAME ns3ai_ltecqi_purecpp
SOURCE_FILES pure_cpp/main.cc
SOURCE_FILES pure-cpp/main.cc
LIBRARIES_TO_LINK # Need not link with ns3-ai because there is no IPC between Python and C++
${libcore}
${TensorFlow_LIBRARIES}
Expand Down
2 changes: 1 addition & 1 deletion examples/lte-cqi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ cd YOUR_NS3_DIRECTORY

```shell
pip install -r contrib/ai/examples/lte-cqi/requirements.txt
cd contrib/ai/examples/lte-cqi/use_msg
cd contrib/ai/examples/lte-cqi/use-msg
python run_online_lstm.py 1
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions examples/rl-tcp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
build_lib_example(
NAME ns3ai_rltcp_gym
SOURCE_FILES
use_gym/sim.cc
use_gym/tcp-rl-env.cc
use_gym/tcp-rl.cc
use-gym/sim.cc
use-gym/tcp-rl-env.cc
use-gym/tcp-rl.cc
LIBRARIES_TO_LINK
${libai}
${libcore}
Expand All @@ -21,9 +21,9 @@ build_lib_example(
build_lib_example(
NAME ns3ai_rltcp_msg
SOURCE_FILES
use_msg/rl-tcp.cc
use_msg/tcp-rl.cc
use_msg/tcp-rl-env.cc
use-msg/rl-tcp.cc
use-msg/tcp-rl.cc
use-msg/tcp-rl-env.cc
LIBRARIES_TO_LINK
${libai}
${libcore}
Expand All @@ -38,9 +38,9 @@ build_lib_example(
${libflow-monitor}
)

pybind11_add_module(ns3ai_rltcp_msg_py use_msg/rl_tcp_py.cc)
pybind11_add_module(ns3ai_rltcp_msg_py use-msg/rl_tcp_py.cc)
set_target_properties(ns3ai_rltcp_msg_py PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/use_msg)
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/use-msg)
target_link_libraries(ns3ai_rltcp_msg_py PRIVATE ${libai})

# Build Python interface along with C++ lib
Expand All @@ -51,9 +51,9 @@ if(NS3AI_LIBTORCH_EXAMPLES)
message(STATUS "RL-TCP pure C++ example enabled")
build_lib_example(
NAME ns3ai_rltcp_purecpp
SOURCE_FILES pure_cpp/rl-tcp.cc
pure_cpp/tcp-rl.cc
pure_cpp/tcp-rl-env.cc
SOURCE_FILES pure-cpp/rl-tcp.cc
pure-cpp/tcp-rl.cc
pure-cpp/tcp-rl-env.cc
LIBRARIES_TO_LINK # Need not link with ns3-ai because there is no IPC between Python and C++
${libcore}
${Torch_LIBRARIES}
Expand Down
4 changes: 2 additions & 2 deletions examples/rl-tcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The following code selects deep Q-learning to TCP congestion control.

```shell
pip install -r contrib/ai/examples/rl-tcp/requirements.txt
cd contrib/ai/examples/rl-tcp/use_gym
cd contrib/ai/examples/rl-tcp/use-gym
python run_rl_tcp.py --use_rl --result --show_log --seed=10
```

Expand All @@ -105,7 +105,7 @@ The following code selects deep Q-learning to TCP congestion control.

```shell
pip install -r contrib/ai/examples/rl-tcp/requirements.txt
cd contrib/ai/examples/rl-tcp/use_msg
cd contrib/ai/examples/rl-tcp/use-msg
python run_rl_tcp.py --use_rl --rl_algo=DeepQ --result --show_log --seed=10
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 17501e6

Please sign in to comment.