提交 d34d6c89 编写于 作者: B baiyfbupt

refine doc

上级 5beed1ec
...@@ -108,6 +108,7 @@ def fsp_loss(teacher_var1_name, teacher_var2_name, student_var1_name, ...@@ -108,6 +108,7 @@ def fsp_loss(teacher_var1_name, teacher_var2_name, student_var1_name,
second dimension, all other dimensions should second dimension, all other dimensions should
be consistent with student_var1. be consistent with student_var1.
program(Program): The input distiller program. program(Program): The input distiller program.
default: fluid.default_main_program()
Return(Variable): fsp distiller loss. Return(Variable): fsp distiller loss.
""" """
teacher_var1 = program.global_block().var(teacher_var1_name) teacher_var1 = program.global_block().var(teacher_var1_name)
...@@ -129,6 +130,7 @@ def l2_loss(teacher_var_name, student_var_name, ...@@ -129,6 +130,7 @@ def l2_loss(teacher_var_name, student_var_name,
teacher_var_name(str): The name of teacher_var. teacher_var_name(str): The name of teacher_var.
student_var_name(str): The name of student_var. student_var_name(str): The name of student_var.
program(Program): The input distiller program. program(Program): The input distiller program.
default: fluid.default_main_program()
Return(Variable): l2 distiller loss. Return(Variable): l2 distiller loss.
""" """
student_var = program.global_block().var(student_var_name) student_var = program.global_block().var(student_var_name)
...@@ -149,6 +151,7 @@ def soft_label_loss(teacher_var_name, ...@@ -149,6 +151,7 @@ def soft_label_loss(teacher_var_name,
teacher_var_name(str): The name of teacher_var. teacher_var_name(str): The name of teacher_var.
student_var_name(str): The name of student_var. student_var_name(str): The name of student_var.
program(Program): The input distiller program. program(Program): The input distiller program.
default: fluid.default_main_program()
teacher_temperature(float): Temperature used to divide teacher_temperature(float): Temperature used to divide
teacher_feature_map before softmax. default: 1.0 teacher_feature_map before softmax. default: 1.0
student_temperature(float): Temperature used to divide student_temperature(float): Temperature used to divide
...@@ -171,6 +174,7 @@ def loss(loss_func, program=fluid.default_main_program(), **kwargs): ...@@ -171,6 +174,7 @@ def loss(loss_func, program=fluid.default_main_program(), **kwargs):
Combine variables from student model and teacher model by self defined loss. Combine variables from student model and teacher model by self defined loss.
Args: Args:
program(Program): The input distiller program. program(Program): The input distiller program.
default: fluid.default_main_program()
loss_func(function): The user self defined loss function. loss_func(function): The user self defined loss function.
Return(Variable): self defined distiller loss. Return(Variable): self defined distiller loss.
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册