code
stringlengths
3
6.57k
Regressor(nn.Module)
__init__(self, smpl_mean_params=SMPL_MEAN_PARAMS, feat_dim=2048, hidden_dim=1024, **kwargs)
super(Regressor, self)
__init__()
nn.Linear(feat_dim + npose + nshape + 3, hidden_dim)
nn.Dropout()
nn.Linear(hidden_dim, hidden_dim)
nn.Dropout()
nn.Linear(hidden_dim, npose)
nn.Linear(hidden_dim, nshape)
nn.Linear(hidden_dim, 3)
nn.init.xavier_uniform_(self.decpose.weight, gain=0.01)
nn.init.xavier_uniform_(self.decshape.weight, gain=0.01)
nn.init.xavier_uniform_(self.deccam.weight, gain=0.01)
np.load(smpl_mean_params)
torch.from_numpy(mean_params['pose'][:])
unsqueeze(0)
torch.from_numpy(mean_params['shape'][:].astype('float32')
unsqueeze(0)
torch.from_numpy(mean_params['cam'])
unsqueeze(0)
self.register_buffer('init_pose', init_pose)
self.register_buffer('init_shape', init_shape)
self.register_buffer('init_cam', init_cam)
iterative_regress(self, x, init_pose=None, init_shape=None, init_cam=None, n_iter=3)
self.init_pose.expand(nt, -1)
self.init_shape.expand(nt, -1)
self.init_cam.expand(nt, -1)
range(n_iter)
torch.cat([x, pred_pose, pred_shape, pred_cam], 1)
self.fc1(xc)
self.drop1(xc)
self.fc2(xc)
self.drop2(xc)
self.decpose(xc)
self.decshape(xc)
self.deccam(xc)
self.iterative_regress(x, init_pose, init_shape, init_cam, n_iter=3)
self.get_output(pred_pose, pred_shape, pred_cam, J_regressor)
get_output(self, pred_pose, pred_shape, pred_cam, J_regressor)
rot6d_to_rotmat(pred_pose)
reshape(nt, -1, 3, 3)
unsqueeze(1)
expand(pred_vertices.shape[0], -1, -1)
to(pred_vertices.device)
torch.matmul(J_regressor_batch, pred_vertices)
projection(pred_joints, pred_cam)
rotation_matrix_to_angle_axis(pred_rotmat.reshape(-1, 3, 3)
reshape(nt, -1)
torch.cat([pred_cam, pose, pred_shape], dim=1)
projection(pred_joints, pred_camera)
torch.zeros(batch_size, 2)
torch.eye(3)
unsqueeze(0)
expand(batch_size, -1, -1)
to(pred_joints.device)
points (bs, N, 3)
rotation (bs, 3, 3)
translation (bs, 3)
focal_length (bs,)
camera_center (bs, 2)
torch.zeros([batch_size, 3, 3], device=points.device)
torch.einsum('bij,bkj->bki', rotation, points)
translation.unsqueeze(1)
unsqueeze(-1)
torch.einsum('bij,bkj->bki', K, projected_points)
information (system wide)
get_bike_stations()
spark.sql("""select distinct(station_id)
toPandas()
apply(lambda x: int(x)
list(stationsOfInterestDF.values.flatten()
dbutils.widgets.removeAll()
dbutils.widgets.dropdown("00.Airport_Code", "JFK", ["JFK","SEA","BOS","ATL","LAX","SFO","DEN","DFW","ORD","CVG","CLT","DCA","IAH"])
dbutils.widgets.text('01.training_start_date', "2018-01-01")
dbutils.widgets.text('02.training_end_date', "2019-03-15")
dbutils.widgets.text('03.inference_date', (dt.strptime(str(dbutils.widgets.get('02.training_end_date')
timedelta(days=1)
strftime("%Y-%m-%d")
dbutils.widgets.text('04.promote_model', "No")
str(dbutils.widgets.get('01.training_start_date')
str(dbutils.widgets.get('02.training_end_date')
str(dbutils.widgets.get('03.inference_date')
str(dbutils.widgets.get('00.Airport_Code')
dbutils.widgets.get("05.promote_model")
print(airport_code,training_start_date,training_end_date,inference_date,promote_model)
MlflowClient()
EXTRACT(year from a.hour)
EXTRACT(dayofweek from a.hour)
EXTRACT(hour from a.hour)
COALESCE(c.tot_precip_mm,0)
TO_DATE(a.hour)
format(end_date, (datetime.strptime(end_date, '%Y-%m-%d')
timedelta(hours=int(hours_to_forecast)
strftime("%Y-%m-%d %H:%M:%S")
fdf.toPandas()
fillna(method='ffill')
fillna(method='bfill')
prod_model.predict(df1.drop(["ds","model"], axis=1)
fdf.toPandas()