diff --git a/tutorials/source_en/debug/profiler.md b/tutorials/source_en/debug/profiler.md index 1cd83e43e27b4be918ff8b60a9a9ea10d3ef2325..d009d5bf9f018c140da165dac03aaae1ecceffaf 100644 --- a/tutorials/source_en/debug/profiler.md +++ b/tutorials/source_en/debug/profiler.md @@ -175,7 +175,7 @@ For the complete case, refer to [dynamic profiler enabling method case](https:// ### Method 3: Environment Variable Enabling -Users can use the environment variable enabling method to enable Profiler most simply. Currently, only single-card scenarios are supported. this method only needs to configure the parameters to the environment variables, and the performance data will be automatically collected during the model training. schedule, on_trace_ready, and experimental_config parameters are not supported in this mode, and other parameters can be used. See [environment variable enabling method parameter details](https://www.mindspore.cn/docs/en/r2.7.0rc1/api_python/env_var_list.html) for details. +Users can use the environment variable enabling method to enable Profiler most simply. Currently, only single-card scenarios are supported. This method only needs to configure the parameters to the environment variables, and the performance data will be automatically collected during the model training. schedule, on_trace_ready, and experimental_config parameters are not supported in this mode, and other parameters can be used. See [environment variable enabling method parameter details](https://www.mindspore.cn/docs/en/r2.7.0rc1/api_python/env_var_list.html) for details. > If environment variables are enabled, set device_id using environment variables before executing the script. Do not use set_context to set device_id in the script. @@ -236,7 +236,7 @@ When using MindSpore to train a model, in order to analyze performance bottlenec After collecting performance data, the original data will be stored according to the following directory structure: > - The following data files are not required to be opened and viewed by users. Users can refer to the [MindStudio Insight user guide](https://www.hiascend.com/document/detail/zh/mindstudio/80RC1/msinsightug/msascendinsightug/AscendInsight_0002.html) for viewing and analyzing performance data. -> - The following is the full set of result files. MindSpore Profiler interface will associate and integrate the framework side data and CANN Profling data to form trace, kernel, and memory performance data files in the `ASCEND_PROFILER_OUTPUT` directory. The actual file number and content depend on the user's parameter configuration and the actual training scenario, if the user does not configure the related parameters or does not involve the related scenarios in the training, the corresponding data files will not be generated. +> - The following is the full set of result files. MindSpore Profiler interface will associate and integrate the framework side data and CANN Profiling data to form trace, kernel, and memory performance data files in the `ASCEND_PROFILER_OUTPUT` directory. The actual file number and content depend on the user's parameter configuration and the actual training scenario, if the user does not configure the related parameters or does not involve the related scenarios in the training, the corresponding data files will not be generated. ```sh └── localhost.localdomain_*_ascend_ms // Collection and analysis result directory, named format: {worker_name}_{timestamp}_ascend_ms, by default {worker_name} is {hostname}_{pid} @@ -280,16 +280,16 @@ After collecting performance data, the original data will be stored according to ├── logs // MindSpore Log files parsed by the Profiler interface └── PROF_000001_20230628101435646_FKFLNPEPPRRCFCBA // CANN layer performance data, named format: PROF_{number}_{timestamp}_{string}, delete other data when data_simplification=True, only retain the original performance data in this directory ├── analyze // Generated when profiler_level=ProfilerLevel.Level1 or profiler_level=ProfilerLevel.Level2 in scenarios where there is communication such as multiple cards or clusters - ├── device_{Rank_ID} // CANN Profling Performance data collected on the device - ├── host // CANN Profling Performance data collected on the host - ├── mindstudio_profiler_log // CANN Profling parsed log files. Delete this directory when data_simplification is set to True - └── mindstudio_profiler_output // CANN Profling parsed performance data. Delete this directory when data_simplification is set to True + ├── device_{Rank_ID} // CANN Profiling Performance data collected on the device + ├── host // CANN Profiling Performance data collected on the host + ├── mindstudio_profiler_log // CANN Profiling parsed log files. Delete this directory when data_simplification is set to True + └── mindstudio_profiler_output // CANN Profiling parsed performance data. Delete this directory when data_simplification is set to True ``` The detailed description of each file in the `ASCEND_PROFILER_OUTPUT` directory is as follows. > - `FRAMEWORK` is the performance raw data of the framework side, no need to pay attention to it. -> - `PROF` directory is the performance data collected by CANN Profling, mainly saved in the `mindstudio_profiler_output` directory. +> - `PROF` directory is the performance data collected by CANN Profiling, mainly saved in the `mindstudio_profiler_output` directory. ### ascend_mindspore_profiler_{Rank_ID}.db diff --git a/tutorials/source_en/debug/sdc.md b/tutorials/source_en/debug/sdc.md index 63213bc9b2f81877ad0b96227aeb79d9b2067f46..a38db65e9b0dfcd3d0eca13accce00e6b4fc7df6 100644 --- a/tutorials/source_en/debug/sdc.md +++ b/tutorials/source_en/debug/sdc.md @@ -12,7 +12,7 @@ During model training, processors may encounter feature value detection anomalie The MindSpore framework version 2.4 provides a solution for feature value detection of Transformer structure models. Internally a feature value detection operator is inserted before the communication operator in the backward graph to monitor feature value and prevent anomaly from spreading to other cards. -For default feature value detection checkpoints, users can enable detection capability using the environment variable `NPU_ASD_ENABLE=1`, `NPU_ASD_ENABLE=2` or `NPU_ASD_ENABLE=3`, and adjust the detection intensity by configuring the environment variables `NPU_ASD_UPPER_THRESH` and `NPU_ASD_SIGMA_THRESH`. +For default feature value detection checkpoints, users can enable detection capability using the environment variable `NPU_ASD_ENABLE=1`, `NPU_ASD_ENABLE=2` or `NPU_ASD_ENABLE=3`, and adjust the detection intensity by configuring the environment variables `NPU_ASD_UPPER_THRESH` and `NPU_ASD_SIGMA_THRESH`. For information on configuring related environment variables, see **Feature Switches and Configuration**. @@ -211,7 +211,7 @@ Start command: NPU_ASD_ENABLE=1 bash run_silent_check.sh ``` -From the CANN log, by default the log path os `~/ascend/log/`, the main `ERROR` logs are as follows, there are many `ERROR` logs. After error was detected, the training process was not stopped. +From the CANN log, by default the log path is `~/ascend/log/`, the main `ERROR` logs are as follows, there are many `ERROR` logs. After error was detected, the training process was not stopped. ```bash $ cd ~/ascend/log/debug/ @@ -244,8 +244,7 @@ device-2/device-305322_20250225184310213.log:1859:[ERROR] AICPU(25787,aicpu_sche #### Execution Result of Setting NPU_ASD_ENABLE to 3 -When `NPU_ASD_ENABLE` was set to `3`, the action is similar to detection level `2`, i.e. if error was detected, print `ERROR` log and stop training process. Besides an `INFO` log as also output for -non anomaly feature values (In oreder to see logs of level INFO, need to set `export ASCEND_GLOBAL_LOG_LEVEL=0` to enable log level `DEBUG` or set `export ASCEND_GLOBAL_LOG_LEVEL=1` to enable log level `INFO`). +When `NPU_ASD_ENABLE` was set to `3`, the action is similar to detection level `2`, i.e. if error was detected, print `ERROR` log and stop training process. Besides an `INFO` log as also output for non anomaly feature values (In oreder to see logs of level INFO, need to set `export ASCEND_GLOBAL_LOG_LEVEL=0` to enable log level `DEBUG` or set `export ASCEND_GLOBAL_LOG_LEVEL=1` to enable log level `INFO`). Start command: @@ -253,7 +252,7 @@ Start command: NPU_ASD_ENABLE=3 bash run_silent_check.sh ``` -From the CANN log, by default the log path os `~/ascend/log/`, the main `ERROR` logs are as follows, there are `INFO` logs except for `ERORR` log about feature value info. +From the CANN log, by default the log path os `~/ascend/log/`, the main `ERROR` logs are as follows, there are `INFO` logs except for `ERROR` log about feature value info. ```bash $ cd ~/ascend/log/debug/ diff --git a/tutorials/source_en/generative/dcgan.md b/tutorials/source_en/generative/dcgan.md index 0795f87a932d6c89a5f4844ac575eddcdd124f99..65af50df919a2a8865a9e4e12a91af42ed540f23 100644 --- a/tutorials/source_en/generative/dcgan.md +++ b/tutorials/source_en/generative/dcgan.md @@ -105,7 +105,7 @@ Use the [create_dict_iterator](https://www.mindspore.cn/docs/en/r2.7.0rc1/api_py import matplotlib.pyplot as plt def plot_data(data): - # Visualize some traing data. + # Visualize some training data. plt.figure(figsize=(10, 3), dpi=140) for i, image in enumerate(data[0][:30], 1): plt.subplot(3, 10, i) @@ -125,7 +125,7 @@ After the data is processed, you can set up a GAN. According to the DCGAN paper, ### Generator -Generator `G` maps the implicit vector `z` to the data space. Because the data is an image, this process also creates an RGB image with the same size as the real image. In practice, this function is implemented by using a series of `Conv2dTranspose` transposed convolutional layers. Each layer is paired with the `BatchNorm2d` layer and `ReLu` activation layer. The output data passes through the `tanh` function and returns a value within the data range of `[-1,1]`. +Generator `G` maps the implicit vector `z` to the data space. Because the data is an image, this process also creates an RGB image with the same size as the real image. In practice, this function is implemented by using a series of `Conv2dTranspose` transposed convolutional layers. Each layer is paired with the `BatchNorm2d` layer and `ReLU` activation layer. The output data passes through the `tanh` function and returns a value within the data range of `[-1,1]`. The following shows the image generated by DCGAN: @@ -240,7 +240,7 @@ Training is divided into two parts: discriminator training and generator trainin - Train the discriminator. - The discriminator is trained to improve the probability of discriminating real images to the greatest extent. According to Goodfellow's approach, we can update the discriminator by increasing its stochastic gradient so as to maximize the value of $log D(x) + log(1 - D(G(z))$. + The discriminator is trained to improve the probability of discriminating real images to the greatest extent. According to Goodfellow's approach, we can update the discriminator by increasing its stochastic gradient so as to maximize the value of $log D(x) + log(1 - D(G(z)))$. - Train the generator. diff --git a/tutorials/source_en/generative/diffusion.md b/tutorials/source_en/generative/diffusion.md index 20d99d8e56fcaffb673e77242ae069205b141845..128efc99ed98da15a617f6cb21210f4ffc1b2822 100644 --- a/tutorials/source_en/generative/diffusion.md +++ b/tutorials/source_en/generative/diffusion.md @@ -6,7 +6,7 @@ This document is based on [Hugging Face: The Annotated Diffusion Model](https:// > This tutorial is successfully executed on Jupyter Notebook. If you download this document as a Python file, ensure that the GUI is installed before executing the Python file. -There are many explanations of diffusion models. This document will introduce it based on denoising diffusion probabilistic model (DDPM). Many remarkable results about DDPM have been achieved for (un)conditional image/audio/video generation. Popular examples include [GLIDE](https://arxiv.org/abs/2112.10741) and [DALL-E 2](https://openai.com/dall-e-2/) by OpenAI, [Latent Diffusion](https://github.com/CompVis/latent-diffusion) by the University of Heidelberg and [Image Generation](https://imagen.research.google/) by Google Brain. +There are many explanations of diffusion models. This document will introduce it based on the denoising diffusion probabilistic model (DDPM). Many remarkable results about DDPM have been achieved for (un)conditional image/audio/video generation. Popular examples include [GLIDE](https://arxiv.org/abs/2112.10741) and [DALL-E 2](https://openai.com/dall-e-2/) by OpenAI, [Latent Diffusion](https://github.com/CompVis/latent-diffusion) by the University of Heidelberg, and [Image Generation](https://imagen.research.google/) by Google Brain. Actually, the idea of diffusion-based generative models was already introduced by [Sohl-Dickstein et al., 2015](https://arxiv.org/abs/1503.03585). [Song et al., 2019](https://arxiv.org/abs/1907.05600) (at Stanford University) and [Ho et al., 2020](https://arxiv.org/abs/2006.11239) (at Google Brain) independently improve the method. @@ -82,7 +82,7 @@ $$ Note that $\beta_t$ is not constant at each time step $t$ (hence the subscript). In fact, we define a so-called "dynamic variance" method, so that $\beta_t$ of each time step can be linear, quadratic, cosine, etc. (a bit like dynamic learning rate method). -Therefore, if we set the schedule properly, starting from $\mathbf{x}_0$, we will end up with $\mathbf{x}_1, ..., \mathbf{x} _t, ..., \mathbf{x}_T$. That is, as $t$ increases, $\mathbf{x}_t$ becomes more similar to pure noise. $\mathbf{x}_T$ is the pure Gaussian noise. +Therefore, if we set the schedule properly, starting from $\mathbf{x}_0$, we will end up with $\mathbf{x}_1, ..., \mathbf{x}_t, ..., \mathbf{x}_T$. That is, as $t$ increases, $\mathbf{x}_t$ becomes more similar to pure noise. $\mathbf{x}_T$ is the pure Gaussian noise. If we know the conditional probability distribution $p(\mathbf{x} _{t-1} | \mathbf{x}_t)$, we can run the process reversely: sample some random Gaussian noise $\mathbf{x}_T$, and then gradually denoise it so that we end up with a sample in the real distribution $\mathbf{x}_0$. However, we do not know the conditional probability distribution $p(\mathbf{x}_{t-1} | \mathbf{x}_t)$. This is intractable since it requires the distribution of all possible images in order to calculate this conditional probability. diff --git a/tutorials/source_en/model_migration/model_migration.md b/tutorials/source_en/model_migration/model_migration.md index 731c14c1e9f5205433cb17540d60665ef781a28a..380696716fbeaf1741fc7658d2d4241e6db4a54f 100644 --- a/tutorials/source_en/model_migration/model_migration.md +++ b/tutorials/source_en/model_migration/model_migration.md @@ -71,7 +71,7 @@ For more use methods, refer to [Dataset.batch](https://www.mindspore.cn/docs/en/ The main differences between MindSpore's GeneratorDataset and PyTorch's DataLoader are: - column_names must be passed in MindSpore's GeneratorDataset; -- PyTorch's data augmentation inputs are of type Tensor, MindSpore's data augmentation inputs are of type numpy, and data processing cannot be done with MindSpore's mint, oops, and nn operators; +- PyTorch's data augmentation inputs are of type Tensor, MindSpore's data augmentation inputs are of type numpy, and data processing cannot be done with MindSpore's mint, ops, and nn operators; - PyTorch's batch operation is a property of the DataLoader, MindSpore's batch operation is a separate method. For more details, refer to [Differences with torch.utils.data.DataLoader](https://www.mindspore.cn/docs/en/r2.7.0rc1/note/api_mapping/pytorch_diff/DataLoader.html). @@ -396,5 +396,5 @@ class Trainer: # Saving the best checkpoint self.best_acc = accuracy ms.save_checkpoint(self.net, "best.ckpt") - print(f"Updata best acc: {accuracy}") + print(f"Update best acc: {accuracy}") ``` diff --git a/tutorials/source_en/nlp/sequence_labeling.md b/tutorials/source_en/nlp/sequence_labeling.md index 2407ca5dd497884a3082d74376b4d5f62e09757a..dda62a9e02c1ed08f6c5581475731b5f585129c6 100644 --- a/tutorials/source_en/nlp/sequence_labeling.md +++ b/tutorials/source_en/nlp/sequence_labeling.md @@ -13,6 +13,7 @@ Sequence labeling refers to the process of labeling each token for a given input |Output Labeling| B | I | I | I | O | O | O | B | I | O | O | As shown in the preceding table, `the wall street journal` and `apple corporation` are place names and need to be identified. We predict the label of each input word and identify the entity based on the label. + > A common labeling method for NER is used, that is, BIOE labeling. The beginning of an entity is labeled as B, other parts are labeled as I, and non-entity is labeled as O. ## Conditional Random Field (CRF) diff --git a/tutorials/source_en/orange_pi/environment_setup.md b/tutorials/source_en/orange_pi/environment_setup.md index 366376d469dcc67c6a3e469be0ccb522de1af2c4..783134c02c8561e286d3bdc495511e9b2595b14b 100644 --- a/tutorials/source_en/orange_pi/environment_setup.md +++ b/tutorials/source_en/orange_pi/environment_setup.md @@ -98,7 +98,7 @@ Here we introduce balenaEtcher, Rufus to burn the image, you can burn according Step 1 Select Mirror, TF card, and start burn. - Insert the sd card into the card reader, insert the card reader into the computer, select the image and sd card, click “Start”. + Insert the sd card into the card reader, insert the card reader into the computer, select the image and sd card, click "Start". ![environment-setup-1-12](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0rc1/tutorials/source_zh_cn/orange_pi/images/environment_setup_1-12.png) @@ -228,7 +228,7 @@ xxx install success - xxx indicates the actual package name of the upgrade. -- Path after installing the upgrade (default installation path for root user as an example): “/usr/local/Ascend/ ascend-toolkit/ +- Path after installing the upgrade (default installation path for root user as an example): "/usr/local/Ascend/ascend-toolkit/" > If the output is incorrect, you need to follow the above steps to upgrade Toolkit again. diff --git a/tutorials/source_en/orange_pi/model_infer.md b/tutorials/source_en/orange_pi/model_infer.md index 5e0a4d80d896f0376b4bb4ce1814357a4846e376..5c9533c1f0b6078685671254fab181f5589aa4e3 100644 --- a/tutorials/source_en/orange_pi/model_infer.md +++ b/tutorials/source_en/orange_pi/model_infer.md @@ -64,11 +64,11 @@ Then enter the URL link you see above in your browser to log into the Jupyter La ![model-infer3](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0rc1/tutorials/source_zh_cn/orange_pi/images/model_infer3.png) -Step 2 In the Jupyter Lab interface, double-click the case directory shown in the figure below, take “04-FCN” as an example here, you can enter the case directory. The operation process of other cases is similar, just select the corresponding case directory and. ipynb file. +Step 2 In the Jupyter Lab interface, double-click the case directory shown in the figure below, take “04-FCN” as an example here, you can enter the case directory. The operation process of other cases is similar, just select the corresponding case directory and .ipynb file. ![model-infer4](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0rc1/tutorials/source_zh_cn/orange_pi/images/model_infer4.png) -Step 3 In this directory there are all the resources to run the sample, where mindspore_fcn8s.ipynb is the file to run the sample in Jupyter Lab. Double-click to open the mindspore_fcn8s.ipynb, which will be displayed in the right window. The contents of the mindspore_fcn8s.ipynb file is shown in the following figure: +Step 3 In this directory there are all the resources to run the sample, where mindspore_fcn8s.ipynb is the file to run the sample in Jupyter Lab. Double-click to open the mindspore_fcn8s.ipynb, which will be displayed in the right window. The contents of the mindspore_fcn8s.ipynb file are shown in the following figure: ![model-infer5](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0rc1/tutorials/source_zh_cn/orange_pi/images/model_infer5.png) diff --git a/tutorials/source_zh_cn/generative/dcgan.ipynb b/tutorials/source_zh_cn/generative/dcgan.ipynb index 94db4438095c238ef732d6b51ed63a2c4c394fe1..92e2fd0ab874c017e1a28e2c29d76aa3a00bbb2f 100644 --- a/tutorials/source_zh_cn/generative/dcgan.ipynb +++ b/tutorials/source_zh_cn/generative/dcgan.ipynb @@ -348,7 +348,7 @@ "\n", "- 训练判别器\n", "\n", - " 训练判别器的目的是最大程度地提高判别图像真伪的概率。按照Goodfellow的方法,是希望通过提高其随机梯度来更新判别器,所以我们要最大化$log D(x) + log(1 - D(G(z))$的值。\n", + " 训练判别器的目的是最大程度地提高判别图像真伪的概率。按照Goodfellow的方法,是希望通过提高其随机梯度来更新判别器,所以我们要最大化$log D(x) + log(1 - D(G(z)))$的值。\n", "\n", "- 训练生成器\n", "\n", diff --git a/tutorials/source_zh_cn/model_migration/model_migration.md b/tutorials/source_zh_cn/model_migration/model_migration.md index 71f768326ce44417f04016979627d12c272a0123..fb805a81716d49930492c7a9cab2ec6f1fe9fc1b 100644 --- a/tutorials/source_zh_cn/model_migration/model_migration.md +++ b/tutorials/source_zh_cn/model_migration/model_migration.md @@ -396,5 +396,5 @@ class Trainer: # 保存最好的那个checkpoint self.best_acc = accuracy ms.save_checkpoint(self.net, "best.ckpt") - print(f"Updata best acc: {accuracy}") + print(f"Update best acc: {accuracy}") ```