**Describe the feature** 我需要调整损失函数类型,并且可能需要自己定义、嵌入损失函数。 当前swift有这样的参数、接口可用吗? **Additional context** Add any other context or information here(其他信息可以写在这里)