Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions depth/model/multivariate/CUDA_approximation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# device = torch.device("cpu")
def cudaApprox(data:torch.Tensor,x:torch.Tensor,notion:str,
solver:str,option:int,NRandom:int,n_refinements:int,sphcap_shrink:float,
step:int=10000,device=None)->torch.Tensor:
step:int=10000,device="cpu")->torch.Tensor:
"""Main function to compute approximated depth based on chosen notion
"""
torch.manual_seed(2801)
Expand Down Expand Up @@ -52,7 +52,7 @@ def RS(data:torch.Tensor,z:torch.Tensor,notion:str,
"""Compute (refined) Random search
"""
eps=torch.tensor([torch.pi/2],dtype=torch.float32,device=device) # initial cap size
pole=normalize(torch.normal(0,1,z.shape)).reshape(z.shape) # first pole
pole=normalize(torch.normal(0,1,z.shape,device=device)).reshape(z.shape) # first pole
dMin=torch.ones((1,1),dtype=torch.float32,device=device)
for ref in range(n_refinements):
dirs=poleCuda(dirs,num_dir=dirRef, pole=pole,eps=eps,device=device)
Expand Down
4 changes: 2 additions & 2 deletions depth/model/multivariate/Halfspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def halfspace(x, data, exact=True, method="recursive",
if CUDA==False:return depth_approximation(x, data, "halfspace", solver, NRandom ,option, n_refinements,
sphcap_shrink, alpha_Dirichlet, cooling_factor, cap_size, start, space, line_solver, bound_gc)
if CUDA==True:
return cudaApprox(data,x, "halfspace", solver, option,NRandom, n_refinements,
sphcap_shrink,device)
return cudaApprox(data,x, "halfspace", solver=solver, option=option,NRandom=NRandom, n_refinements=n_refinements,
sphcap_shrink=sphcap_shrink,device=device)

halfspace.__doc__="""

Expand Down
Loading