code
stringlengths
3
6.57k
plt.colorbar()
plt.savefig(imagesavefilenamedif_1)
plt.figure(figsize=(14, 7)
plt.imshow(dif_freesurfer_moved)
plt.title('freesurfer_moved')
plt.colorbar()
plt.savefig(imagesavefilenamedif_2)
moved.detach()
cpu()
numpy()
squeeze()
vxm.py.utils.save_volfile(moved, args.moved, fixed_affine)
warp.detach()
cpu()
numpy()
squeeze()
vxm.py.utils.save_volfile(warp, args.warp, fixed_affine)
project (https://www.pymor.org)
License (https://opensource.org/licenses/BSD-2-Clause)
ResidualReductor(BasicObject)
residual.apply(U, mu)
operator.apply(U, mu)
rhs.as_range_array(mu)
residual.apply(U, mu)
product.apply_inverse(operator.apply(U, mu)
rhs.as_range_array(mu)
project(residual, range_basis=residual_range, source_basis=RB)
the (dual)
projected_residual.apply(u, mu)
norm()
residual_reductor.reconstruct(projected_residual.apply(u, mu)
residual.apply(RB.lincomb(u)
__init__(self, RB, operator, rhs=None, product=None, riesz_representatives=False)
or (rhs.source.is_scalar and rhs.range == operator.range and rhs.linear)
self.__auto_init(locals()
operator.range.empty()
reduce(self)
self.logger.block('Estimating residual range ...')
self.logger.warning(f'Cannot compute range of {e.op}. Evaluation will be slow.')
project(self.operator, None, self.RB)
NonProjectedResidualOperator(operator, self.rhs, self.riesz_representatives, self.product)
self.logger.block('Projecting residual operator ...')
project(self.operator, self.residual_range, self.RB, product=None)
project(self.rhs, self.residual_range, None, product=None)
project(self.operator, self.residual_range, self.RB, product=self.product)
project(self.rhs, self.residual_range, None, product=self.product)
ResidualOperator(operator, rhs)
reconstruct(self, u)
u.norm()
u.norm(self.product)
lincomb(u.to_numpy()
ResidualOperator(Operator)
__init__(self, operator, rhs, name=None)
self.__auto_init(locals()
rhs.as_range_array()
apply(self, U, mu=None)
self.operator.apply(U, mu=mu)
self.rhs.as_range_array(mu)
len(V)
len(V)
projected_to_subbasis(self, dim_range=None, dim_source=None, name=None)
ResidualOperator(project_to_subbasis(self.operator, dim_range, dim_source)
project_to_subbasis(self.rhs, dim_range, None)
NonProjectedResidualOperator(ResidualOperator)
__init__(self, operator, rhs, riesz_representatives, product)
super()
__init__(operator, rhs)
self.__auto_init(locals()
apply(self, U, mu=None)
super()
apply(U, mu=mu)
self.product.apply_inverse(R)
R_riesz.norm()
np.nan_to_num(inversel2)
R_riesz.scal(np.sqrt(R_riesz.pairwise_inner(R)
R.norm()
np.nan_to_num(inversel2)
R.scal(np.sqrt(self.product.pairwise_apply2(R, R)
projected_to_subbasis(self, dim_range=None, dim_source=None, name=None)
self.with_(operator=project_to_subbasis(self.operator, None, dim_source)
ImplicitEulerResidualReductor(BasicObject)
riesz_residual.apply(U, U_old, mu)
product.apply_inverse(operator.apply(U, mu)
mass.apply(U, mu)
mass.apply(U_old, mu)
rhs.as_vector(mu)
riesz_residual.projected(range_basis=residual_range, source_basis=RB)
projected_riesz_residual.apply(u, u_old, mu)
norm()
residual_reductor.reconstruct(projected_riesz_residual.apply(u, u_old, mu)
riesz_residual.apply(RB.lincomb(u)
RB.lincomb(u_old)
__init__(self, RB, operator, mass, dt, rhs=None, product=None)
self.__auto_init(locals()
operator.range.empty()
reduce(self)
self.logger.block('Estimating residual range ...')
self.logger.warning(f'Cannot compute range of {e.op}. Evaluation will be slow.')
project(self.operator, None, self.RB)
project(self.mass, None, self.RB)