mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-10-31 16:21:27 +08:00 
			
		
		
		
	Add Hinge, Huber and LogCosh losses (#199)
This commit is contained in:
		 Nicholas Santavas
					Nicholas Santavas
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							e8deca84e0
						
					
				
				
					commit
					d35fa1db41
				
			| @@ -123,7 +123,7 @@ To get more detailed information on the arrays in a :class:`Module` you can use | ||||
| all the parameters in a :class:`Module` do: | ||||
|  | ||||
| .. code-block:: python | ||||
|      | ||||
|  | ||||
|    from mlx.utils import tree_map | ||||
|    shapes = tree_map(lambda p: p.shape, mlp.parameters()) | ||||
|  | ||||
| @@ -131,7 +131,7 @@ As another example, you can count the number of parameters in a :class:`Module` | ||||
| with: | ||||
|  | ||||
| .. code-block:: python | ||||
|      | ||||
|  | ||||
|    from mlx.utils import tree_flatten | ||||
|    num_params = sum(v.size for _, v in tree_flatten(mlp.parameters())) | ||||
|  | ||||
|   | ||||
| @@ -16,4 +16,7 @@ Loss Functions | ||||
|    mse_loss | ||||
|    nll_loss | ||||
|    smooth_l1_loss | ||||
|    triplet_loss | ||||
|    triplet_loss | ||||
|    hinge_loss | ||||
|    huber_loss | ||||
|    log_cosh_loss | ||||
		Reference in New Issue
	
	Block a user