diff --git a/MindFlow/mindflow/cell/diffusion.py b/MindFlow/mindflow/cell/diffusion.py index ee2b8b67d084322de54546f724afac4f81e4f725..0d6d5d7e664972b4f54b31bb47af3dc2e9685833 100644 --- a/MindFlow/mindflow/cell/diffusion.py +++ b/MindFlow/mindflow/cell/diffusion.py @@ -391,7 +391,7 @@ class DDPMScheduler(DiffusionScheduler): beta_schedule (str): The beta schedule, a mapping from a beta range to a sequence of betas for stepping the model. Choose from `linear`, `scaled_linear`, or `squaredcos_cap_v2`. Default: ``squaredcos_cap_v2``. prediction_type (str): Prediction type of the scheduler function; can be `epsilon` (predicts the noise of the diffusion process), - `sample` (directly predicts the noisy sample`) or `v_prediction` (see section 2.4 of `Imagen + `sample` (directly predicts the noisy sample) or `v_prediction` (see section 2.4 of `Imagen Video `_ paper). Default: ``epsilon``. variance_type (str): Clip the variance when adding noise to the denoised sample. Choose from ``fixed_small``, ``fixed_small_log``, ``fixed_large``, ``fixed_large_log``, ``learned`` or ``learned_range``. Default: ``fixed_small_log``. diff --git a/docs/api_python/mindearth/module/mindearth.module.Trainer.rst b/docs/api_python/mindearth/module/mindearth.module.Trainer.rst index 6377c20d72bcde68abeb2000ab2f0c496377cbd9..3a7e8b56c120f8c95c860fa155998f213feef8a4 100644 --- a/docs/api_python/mindearth/module/mindearth.module.Trainer.rst +++ b/docs/api_python/mindearth/module/mindearth.module.Trainer.rst @@ -21,6 +21,17 @@ mindearth.module.Trainer - **TypeError** - 如果 `model` 或 `loss_fn` 不是mindspore.nn.Cell。 - **NotImplementedError** - 如果 `get_callback` 的方法没有实现。 + .. py:method:: mindearth.module.Trainer.get_callback() + + 用于定义模型的回调类。用户必须自定义重写该方法。 + + .. py:method:: mindearth.module.Trainer.get_checkpoint() + + 获得模型的checkpoint实例。 + + 返回: + Callback,模型的checkpoint实例. + .. py:method:: mindearth.module.Trainer.get_data_generator() 生成用于训练和验证数据集的数据生成器。 @@ -49,17 +60,6 @@ mindearth.module.Trainer 返回: Optimizer,模型的优化器。 - .. py:method:: mindearth.module.Trainer.get_checkpoint() - - 获得模型的checkpoint实例。 - - 返回: - Callback,模型的checkpoint实例. - - .. py:method:: mindearth.module.Trainer.get_callback() - - 用于定义模型的回调类。用户必须自定义重写该方法。 - .. py:method:: mindearth.module.Trainer.get_solver() 获得模型训练的求解器。 diff --git a/docs/api_python/mindearth/module/mindearth.module.WeatherForecast.rst b/docs/api_python/mindearth/module/mindearth.module.WeatherForecast.rst index 0876c03e8ec98a28b6de7514f7dba77ac701a4d6..984ffdc76ab4b1b242bbe134da28bfb56736c978 100644 --- a/docs/api_python/mindearth/module/mindearth.module.WeatherForecast.rst +++ b/docs/api_python/mindearth/module/mindearth.module.WeatherForecast.rst @@ -16,22 +16,6 @@ mindearth.module.WeatherForecast .. note:: 需要重写其中的成员函数 `forecast` 用于定义模型推理的前向过程。 - .. py:method:: mindearth.module.WeatherForecast.forecast(inputs, labels=None) - - 模型的预测方法。 - - 参数: - - **inputs** (Tensor) - 模型的输入数据。 - - **labels** (Tensor) - 样本真实数据。默认值: ``None``。 - - .. py:method:: mindearth.module.WeatherForecast.eval(dataset, generator_flag=False) - - 根据验证集数据或测试集数据执行模型推理。 - - 参数: - - **dataset** (mindspore.dataset) - 模型推理数据集,包括输入值和样本值。 - - **generator_flag** (bool) - 用于向 "compute_total_rmse_acc" 方法传递一个参数。指示是否使用数据生成器。默认值: ``False``。 - .. py:method:: mindearth.module.WeatherForecast.compute_total_rmse_acc(dataset, generator_flag) 计算数据集的总体均方根误差(RMSE)和准确率。 @@ -48,3 +32,21 @@ mindearth.module.WeatherForecast 异常: - **NotImplementedError** - 如果指定了不支持的数据源。 + + .. py:method:: mindearth.module.WeatherForecast.eval(dataset, generator_flag=False) + + 根据验证集数据或测试集数据执行模型推理。 + + 参数: + - **dataset** (mindspore.dataset) - 模型推理数据集,包括输入值和样本值。 + - **generator_flag** (bool) - 用于向 "compute_total_rmse_acc" 方法传递一个参数。指示是否使用数据生成器。默认值: ``False``。 + + .. py:method:: mindearth.module.WeatherForecast.forecast(inputs, labels=None) + :staticmethod: + + 模型的预测方法。 + + 参数: + - **inputs** (Tensor) - 模型的输入数据。 + - **labels** (Tensor) - 样本真实数据。默认值: ``None``。 + diff --git a/docs/api_python/mindflow/cell/mindflow.cell.DDIMScheduler.rst b/docs/api_python/mindflow/cell/mindflow.cell.DDIMScheduler.rst index de0b668a26983e7d3e8f44f3c81efa62ae0539fb..a7960e9eae2c3f7ec1cec5793cc4d2942aa4df2d 100644 --- a/docs/api_python/mindflow/cell/mindflow.cell.DDIMScheduler.rst +++ b/docs/api_python/mindflow/cell/mindflow.cell.DDIMScheduler.rst @@ -20,7 +20,7 @@ mindflow.cell.DDIMScheduler - **rescale_betas_zero_snr** (bool) - 是否重新缩放 betas 以使其终端 SNR 为零。这使模型能够生成非常明亮和黑暗的样本,而不是将其限制为中等亮度的样本。与 `offset_noise `_ 松散相关。默认值: ``False`` 。 - **compute_dtype** (mindspore.dtype) - 数据类型。默认值: ``mstype.float32`` ,表示 ``mindspore.float32`` 。 - .. py:method:: add_noise(original_samples, noise, timesteps) + .. py:method:: add_noise(original_samples: Tensor, noise: Tensor, timesteps: Tensor) DDIM前向加噪步骤。 diff --git a/docs/api_python/mindflow/cell/mindflow.cell.DiffusionTransformer.rst b/docs/api_python/mindflow/cell/mindflow.cell.DiffusionTransformer.rst index f07a19b1433ad84557ec7ee5f0a5a895f98467eb..62c9ac8314d6b009148df7360f717e8d8914d92c 100644 --- a/docs/api_python/mindflow/cell/mindflow.cell.DiffusionTransformer.rst +++ b/docs/api_python/mindflow/cell/mindflow.cell.DiffusionTransformer.rst @@ -12,7 +12,7 @@ mindflow.cell.DiffusionTransformer - **layers** (int) - `Transformer` 层数。 - **heads** (int) - 注意力头数。 - **time_token_cond** (bool) - 是否将时间作为作为条件token。 Default: ``True`` 。 - - **compute_dtype** (mindspore.dtype) 计算数据类型。支持 ``mstype.float32`` or ``mstype.float16`` 。 默认值: ``mstype.float32`` ,表示 ``mindspore.float32`` 。 + - **compute_dtype** (mindspore.dtype) - 计算数据类型。支持 ``mstype.float32`` or ``mstype.float16`` 。 默认值: ``mstype.float32`` ,表示 ``mindspore.float32`` 。 输入: - **x** (Tensor) - 网络输入。shape为 :math:`(batch\_size, sequence\_len, in\_channels)` 的Tensor。