9 盛泳潘 When Knowledge Graph meet Python KG引领KE复兴 Knowledge graph is a large-scale semantic network consisting of entities and concepts as well as the semantic relationships among them • Large scale • Semantically rich • Friendly structure Preliminaries 本页PPT借鉴于复旦大学肖仰华老师 《Data-driven Approaches for Large-scale Knowledge Graph Construction》 Knowledge Graph – KG引领KE复兴 Common large-scale KG Preliminaries 名称 开始时间 依赖资源 规模#(实体/概念/关系/ 事实) Cyc/OpenCyc Data Management Domain-specific Knowledge Graph Construction 1 Data-driven approaches for large-scale KG construction The Pipeline of Knowledge Graph Construction by Data-driven manner Data-driven0 码力 | 57 页 | 1.98 MB | 1 年前3
2 使用Python训练和部署低精度模型 张校捷Define static loss scale loss_scale_value = 1024 loss_scale = tf.train.experimental.FixedLossScale(loss_scale_value) opt = tf.train.experimental.MixedPrecisionLossScaleOptimizer(opt, loss_scale) # Define dynamic dynamic loss scale loss_scale = tf.train.experimental.DynamicLossScale( initial_loss_scale = loss_scale_value, increment_period = 2000, multiplier = 2.0, ) opt = tf.train.experimental.MixedPrecisionL MixedPrecisionLossScaleOptimizer(opt, loss_scale) TensorFlow自动混合精度(Automatic Mixed Precision,AMP) 1.设置环境变量 TF_ENABLE_AUTO_MIXED_PRECISION=“1” 2.在代码中手动开启(1和2选项互相冲突,同时设置会报错) # Define optimizer opt = tf.train.AdamOptimizer()0 码力 | 24 页 | 981.45 KB | 1 年前3
MuPDF 1.25.0 Documentationthe zoom and rotation desired. */ /* The default resolution without scaling is 72 dpi. */ ctm = fz_scale(zoom / 100, zoom / 100); ctm = fz_pre_rotate(ctm, rotate); /* Render page to an RGB pixmap. */ fz_try(ctx) left, fz_matrix right); Concat two matrices and returns a new matrix. fz_matrix fz_scale(float sx, float sy); Scale. fz_matrix fz_shear(float sx, float sy); Shear. fz_matrix fz_rotate(float degrees); fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char *src, int n, int depth, size_t stride, int scale); Unpack pixel values from source data to fill in the pixmap samples. n is the number of samples0 码力 | 259 页 | 1.11 MB | 8 月前3
MuPDF 1.23.0 Documentationthe zoom and rotation desired. */ /* The default resolution without scaling is 72 dpi. */ ctm = fz_scale(zoom / 100, zoom / 100); ctm = fz_pre_rotate(ctm, rotate); /* Render page to an RGB pixmap. */ fz_try(ctx) left, fz_matrix right); Concat two matrices and returns a new matrix. fz_matrix fz_scale(float sx, float sy); Scale. fz_matrix fz_shear(float sx, float sy); Shear. fz_matrix fz_rotate(float degrees); fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char *src, int n, int depth, size_t stride, int scale); Unpack pixel values from source data to fill in the pixmap samples. n is the number of samples0 码力 | 245 页 | 817.74 KB | 8 月前3
PyMuPDF 1.24.2 Documentationheight / 2. # rect middle means y = 0 x_step = rect.width / 360 # rect width means 360 degrees y_scale = rect.height / 2. # rect height means 2 sin_points = [] # sine values go here cos_points = [] # * deg) # sine p = (x_coord, y * y_scale + first_y) # corresponding point sin_points.append(p) # append y = -math.cos(x * deg) # cosine p = (x_coord, y * y_scale + first_y) # corresponding point cos_points mytime() # start a timer filename = sys.argv[1] mat = fitz.Matrix(0.2, 0.2) # the rendering matrix: scale down to 20% cpu = cpu_count() # make vectors of arguments for the processes vectors = [(i, cpu,0 码力 | 565 页 | 6.84 MB | 1 年前3
MuPDF 1.24.0 Documentationthe zoom and rotation desired. */ /* The default resolution without scaling is 72 dpi. */ ctm = fz_scale(zoom / 100, zoom / 100); ctm = fz_pre_rotate(ctm, rotate); /* Render page to an RGB pixmap. */ fz_try(ctx) left, fz_matrix right); Concat two matrices and returns a new matrix. fz_matrix fz_scale(float sx, float sy); Scale. fz_matrix fz_shear(float sx, float sy); Shear. fz_matrix fz_rotate(float degrees); fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char *src, int n, int depth, size_t stride, int scale); Unpack pixel values from source data to fill in the pixmap samples. n is the number of samples0 码力 | 249 页 | 830.15 KB | 8 月前3
MuPDF 1.22.0 Documentationthe zoom and rotation desired. */ /* The default resolution without scaling is 72 dpi. */ ctm = fz_scale(zoom / 100, zoom / 100); ctm = fz_pre_rotate(ctm, rotate); /* Render page to an RGB pixmap. */ fz_try(ctx) [a,b,c,d,e,f]. Properties Identity The identity matrix, short hand for [1,0,0,1,0,0]. Methods Scale(sx, sy) Returns a scaling matrix, short hand for [sx,0,0,sy,0,0]. Returns [a,b,c,d,e,f]. Translate(tx MuPDF Documentation, Release 1.21.2 Text state • op_Tc(charSpace) • op_Tw(wordSpace) • op_Tz(scale) • op_TL(leading) • op_Tf(name, size) • op_Tr(render) • op_Ts(rise) Text positioning • op_Td(tx0 码力 | 175 页 | 698.87 KB | 8 月前3
Conda 23.7.x Documentation_get_field(cant_be_number, raw_string, convert_to, ...) _to_decimal_string(ticks) _hz_short_to_full(ticks, scale) continues on next page 246 Chapter 5. Developer guide conda, Release 23.7.4.dev7 Table 10 – continued continued from previous page _hz_friendly_to_full(hz_string) _hz_short_to_friendly(ticks, scale) _to_friendly_bytes(input) _friendly_bytes_to_int(friendly_bytes) _parse_cpu_brand_string(cpu_string) *field_names) _to_decimal_string(ticks) _hz_short_to_full(ticks, scale) _hz_friendly_to_full(hz_string) _hz_short_to_friendly(ticks, scale) _to_friendly_bytes(input) _friendly_bytes_to_int(friendly_bytes)0 码力 | 795 页 | 4.91 MB | 8 月前3
Mypy 1.8.0 Documentation– Carl Meyer: Type Checked Python in the Real World (PyCon 2018) – Greg Price: Clearer Code at Scale: Static Types at Zulip and Dropbox (PyCon 2018) • Look at solutions to common issues with mypy if typing import TypeVar T = TypeVar('T', bound='Shape') class Shape: def set_scale(self: T, scale: float) -> T: self.scale = scale return self class Circle(Shape): def set_radius(self, r: float) -> 'Circle': 'Square': self.width = w return self circle: Circle = Circle().set_scale(0.5).set_radius(2.7) square: Square = Square().set_scale(0.5).set_width(3.2) Without using generic self, the last two lines could0 码力 | 234 页 | 902.89 KB | 1 年前3
Mypy 1.10.0+dev DocumentationReal World [https://www.youtube.com/watch?v=pMgmKJyWKn8] (PyCon 2018) Greg Price: Clearer Code at Scale: Static Types at Zulip and Dropbox [https://www.youtube.com/watch?v=0c46YHS3RY8] (PyCon 2018) Look import TypeVar T = TypeVar('T', bound='Shape') class Shape: def set_scale(self: T, scale: float) -> T: self.scale = scale return self class Circle(Shape): def set_radius(self, r: self.width = w return self circle: Circle = Circle().set_scale(0.5).set_radius(2.7) square: Square = Square().set_scale(0.5).set_width(3.2) Without using generic self, the last two lines could0 码力 | 318 页 | 270.84 KB | 1 年前3
共 310 条
- 1
- 2
- 3
- 4
- 5
- 6
- 31













