repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jxtech/wechatpy | wechatpy/client/api/marketing.py | WeChatMarketing.add_user_actions | def add_user_actions(self, actions=(), version='v1.0'):
"""
回传数据
https://wximg.qq.com/wxp/pdftool/get.html?id=rkalQXDBM&pa=39
:param actions: 用户行为源类型
:param version: 版本号 v1.0
"""
return self._post(
'user_actions/add',
params={'version': v... | python | def add_user_actions(self, actions=(), version='v1.0'):
"""
回传数据
https://wximg.qq.com/wxp/pdftool/get.html?id=rkalQXDBM&pa=39
:param actions: 用户行为源类型
:param version: 版本号 v1.0
"""
return self._post(
'user_actions/add',
params={'version': v... | [
"def",
"add_user_actions",
"(",
"self",
",",
"actions",
"=",
"(",
")",
",",
"version",
"=",
"'v1.0'",
")",
":",
"return",
"self",
".",
"_post",
"(",
"'user_actions/add'",
",",
"params",
"=",
"{",
"'version'",
":",
"version",
"}",
",",
"json",
"=",
"{",... | 回传数据
https://wximg.qq.com/wxp/pdftool/get.html?id=rkalQXDBM&pa=39
:param actions: 用户行为源类型
:param version: 版本号 v1.0 | [
"回传数据"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/marketing.py#L51-L64 | train | Add user actions to a user | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/client/api/marketing.py | WeChatMarketing.get_ad_leads | def get_ad_leads(self, start_date=None, end_date=None, filtering=(), page=1, page_size=100, version='v1.0'):
"""
获取朋友圈销售线索数据接口
:param start_date: 开始日期 默认今天
:param end_date: 结束日期 默认今天
:param filtering: 过滤条件 [{field: 过滤字段, operator: 操作符, values: 字段取值}]
:param page: 页码,获取指... | python | def get_ad_leads(self, start_date=None, end_date=None, filtering=(), page=1, page_size=100, version='v1.0'):
"""
获取朋友圈销售线索数据接口
:param start_date: 开始日期 默认今天
:param end_date: 结束日期 默认今天
:param filtering: 过滤条件 [{field: 过滤字段, operator: 操作符, values: 字段取值}]
:param page: 页码,获取指... | [
"def",
"get_ad_leads",
"(",
"self",
",",
"start_date",
"=",
"None",
",",
"end_date",
"=",
"None",
",",
"filtering",
"=",
"(",
")",
",",
"page",
"=",
"1",
",",
"page_size",
"=",
"100",
",",
"version",
"=",
"'v1.0'",
")",
":",
"today",
"=",
"datetime",... | 获取朋友圈销售线索数据接口
:param start_date: 开始日期 默认今天
:param end_date: 结束日期 默认今天
:param filtering: 过滤条件 [{field: 过滤字段, operator: 操作符, values: 字段取值}]
:param page: 页码,获取指定页数据
:param page_size: 一页获取的数据条数(1-100)
:param version: 版本号 v1.0 | [
"获取朋友圈销售线索数据接口"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/marketing.py#L66-L97 | train | Get a list of ad leads. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/pay/api/order.py | WeChatOrder.create | def create(self, trade_type, body, total_fee, notify_url, client_ip=None,
user_id=None, out_trade_no=None, detail=None, attach=None,
fee_type='CNY', time_start=None, time_expire=None, goods_tag=None,
product_id=None, device_info=None, limit_pay=None, scene_info=None, sub_use... | python | def create(self, trade_type, body, total_fee, notify_url, client_ip=None,
user_id=None, out_trade_no=None, detail=None, attach=None,
fee_type='CNY', time_start=None, time_expire=None, goods_tag=None,
product_id=None, device_info=None, limit_pay=None, scene_info=None, sub_use... | [
"def",
"create",
"(",
"self",
",",
"trade_type",
",",
"body",
",",
"total_fee",
",",
"notify_url",
",",
"client_ip",
"=",
"None",
",",
"user_id",
"=",
"None",
",",
"out_trade_no",
"=",
"None",
",",
"detail",
"=",
"None",
",",
"attach",
"=",
"None",
","... | 统一下单接口
:param trade_type: 交易类型,取值如下:JSAPI,NATIVE,APP,WAP, MWEB
:param body: 商品描述
:param total_fee: 总金额,单位分
:param notify_url: 接收微信支付异步通知回调地址
:param client_ip: 可选,APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP
:param user_id: 可选,用户在商户appid下的唯一标识。trade_type=JSAPI和appid已设定,此参数必传
... | [
"统一下单接口"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/order.py#L16-L80 | train | Create a new node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/pay/api/order.py | WeChatOrder.close | def close(self, out_trade_no):
"""
关闭订单
:param out_trade_no: 商户系统内部的订单号
:return: 返回的结果数据
"""
data = {
'appid': self.appid,
'out_trade_no': out_trade_no,
}
return self._post('pay/closeorder', data=data) | python | def close(self, out_trade_no):
"""
关闭订单
:param out_trade_no: 商户系统内部的订单号
:return: 返回的结果数据
"""
data = {
'appid': self.appid,
'out_trade_no': out_trade_no,
}
return self._post('pay/closeorder', data=data) | [
"def",
"close",
"(",
"self",
",",
"out_trade_no",
")",
":",
"data",
"=",
"{",
"'appid'",
":",
"self",
".",
"appid",
",",
"'out_trade_no'",
":",
"out_trade_no",
",",
"}",
"return",
"self",
".",
"_post",
"(",
"'pay/closeorder'",
",",
"data",
"=",
"data",
... | 关闭订单
:param out_trade_no: 商户系统内部的订单号
:return: 返回的结果数据 | [
"关闭订单"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/order.py#L97-L108 | train | Close the order. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/pay/api/order.py | WeChatOrder.get_appapi_params | def get_appapi_params(self, prepay_id, timestamp=None, nonce_str=None):
"""
获取 APP 支付参数
:param prepay_id: 统一下单接口返回的 prepay_id 参数值
:param timestamp: 可选,时间戳,默认为当前时间戳
:param nonce_str: 可选,随机字符串,默认自动生成
:return: 签名
"""
data = {
'appid': self.appid,... | python | def get_appapi_params(self, prepay_id, timestamp=None, nonce_str=None):
"""
获取 APP 支付参数
:param prepay_id: 统一下单接口返回的 prepay_id 参数值
:param timestamp: 可选,时间戳,默认为当前时间戳
:param nonce_str: 可选,随机字符串,默认自动生成
:return: 签名
"""
data = {
'appid': self.appid,... | [
"def",
"get_appapi_params",
"(",
"self",
",",
"prepay_id",
",",
"timestamp",
"=",
"None",
",",
"nonce_str",
"=",
"None",
")",
":",
"data",
"=",
"{",
"'appid'",
":",
"self",
".",
"appid",
",",
"'partnerid'",
":",
"self",
".",
"mch_id",
",",
"'prepayid'",
... | 获取 APP 支付参数
:param prepay_id: 统一下单接口返回的 prepay_id 参数值
:param timestamp: 可选,时间戳,默认为当前时间戳
:param nonce_str: 可选,随机字符串,默认自动生成
:return: 签名 | [
"获取",
"APP",
"支付参数"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/order.py#L110-L129 | train | get_appapi_params - Get the params for the APP API | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/pay/api/order.py | WeChatOrder.reverse | def reverse(self, transaction_id=None, out_trade_no=None):
"""
撤销订单
:param transaction_id: 可选,微信的订单号,优先使用
:param out_trade_no: 可选,商户系统内部的订单号,
transaction_id、out_trade_no二选一,
如果同时存在优先级:transaction_id> out_trade_no
:return: 返... | python | def reverse(self, transaction_id=None, out_trade_no=None):
"""
撤销订单
:param transaction_id: 可选,微信的订单号,优先使用
:param out_trade_no: 可选,商户系统内部的订单号,
transaction_id、out_trade_no二选一,
如果同时存在优先级:transaction_id> out_trade_no
:return: 返... | [
"def",
"reverse",
"(",
"self",
",",
"transaction_id",
"=",
"None",
",",
"out_trade_no",
"=",
"None",
")",
":",
"data",
"=",
"{",
"'appid'",
":",
"self",
".",
"appid",
",",
"'transaction_id'",
":",
"transaction_id",
",",
"'out_trade_no'",
":",
"out_trade_no",... | 撤销订单
:param transaction_id: 可选,微信的订单号,优先使用
:param out_trade_no: 可选,商户系统内部的订单号,
transaction_id、out_trade_no二选一,
如果同时存在优先级:transaction_id> out_trade_no
:return: 返回的结果数据 | [
"撤销订单"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/pay/api/order.py#L131-L146 | train | reverse 单号 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/client/api/user.py | WeChatUser.get | def get(self, user_id, lang='zh_CN'):
"""
获取用户基本信息(包括UnionID机制)
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839
:param user_id: 普通用户的标识,对当前公众号唯一
:param lang: 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
:return: 返回的 JSON 数据包
使用示例::
... | python | def get(self, user_id, lang='zh_CN'):
"""
获取用户基本信息(包括UnionID机制)
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839
:param user_id: 普通用户的标识,对当前公众号唯一
:param lang: 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
:return: 返回的 JSON 数据包
使用示例::
... | [
"def",
"get",
"(",
"self",
",",
"user_id",
",",
"lang",
"=",
"'zh_CN'",
")",
":",
"assert",
"lang",
"in",
"(",
"'zh_CN'",
",",
"'zh_TW'",
",",
"'en'",
")",
",",
"'lang can only be one of \\\n zh_CN, zh_TW, en language codes'",
"return",
"self",
".",
"... | 获取用户基本信息(包括UnionID机制)
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839
:param user_id: 普通用户的标识,对当前公众号唯一
:param lang: 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
:return: 返回的 JSON 数据包
使用示例::
from wechatpy import WeChatClient
client... | [
"获取用户基本信息(包括UnionID机制)",
"详情请参考",
"https",
":",
"//",
"mp",
".",
"weixin",
".",
"qq",
".",
"com",
"/",
"wiki?t",
"=",
"resource",
"/",
"res_main&id",
"=",
"mp1421140839"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/user.py#L11-L37 | train | Get user info | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/client/api/user.py | WeChatUser.get_followers | def get_followers(self, first_user_id=None):
"""
获取一页用户列表(当关注用户过多的情况下,这个接口只会返回一部分用户)
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840
:param first_user_id: 可选。第一个拉取的 OPENID,不填默认从头开始拉取
:return: 返回的 JSON 数据包
使用示例::
from wechatp... | python | def get_followers(self, first_user_id=None):
"""
获取一页用户列表(当关注用户过多的情况下,这个接口只会返回一部分用户)
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840
:param first_user_id: 可选。第一个拉取的 OPENID,不填默认从头开始拉取
:return: 返回的 JSON 数据包
使用示例::
from wechatp... | [
"def",
"get_followers",
"(",
"self",
",",
"first_user_id",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"first_user_id",
":",
"params",
"[",
"'next_openid'",
"]",
"=",
"first_user_id",
"return",
"self",
".",
"_get",
"(",
"'user/get'",
",",
"params... | 获取一页用户列表(当关注用户过多的情况下,这个接口只会返回一部分用户)
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840
:param first_user_id: 可选。第一个拉取的 OPENID,不填默认从头开始拉取
:return: 返回的 JSON 数据包
使用示例::
from wechatpy import WeChatClient
client = WeChatClient('appid',... | [
"获取一页用户列表",
"(",
"当关注用户过多的情况下,这个接口只会返回一部分用户",
")"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/user.py#L39-L63 | train | Get list of followers. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/client/api/user.py | WeChatUser.iter_followers | def iter_followers(self, first_user_id=None):
"""
获取所有的用户openid列表
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840
:return: 返回一个迭代器,可以用for进行循环,得到openid
使用示例::
from wechatpy import WeChatClient
client = WeChatClient('appi... | python | def iter_followers(self, first_user_id=None):
"""
获取所有的用户openid列表
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840
:return: 返回一个迭代器,可以用for进行循环,得到openid
使用示例::
from wechatpy import WeChatClient
client = WeChatClient('appi... | [
"def",
"iter_followers",
"(",
"self",
",",
"first_user_id",
"=",
"None",
")",
":",
"while",
"True",
":",
"follower_data",
"=",
"self",
".",
"get_followers",
"(",
"first_user_id",
")",
"first_user_id",
"=",
"follower_data",
"[",
"\"next_openid\"",
"]",
"# 微信有个bug... | 获取所有的用户openid列表
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140840
:return: 返回一个迭代器,可以用for进行循环,得到openid
使用示例::
from wechatpy import WeChatClient
client = WeChatClient('appid', 'secret')
for openid in client.user.iter_followers... | [
"获取所有的用户openid列表"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/user.py#L65-L94 | train | Iterate over followers. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/client/api/user.py | WeChatUser.get_group_id | def get_group_id(self, user_id):
"""
获取用户所在分组 ID
详情请参考
http://mp.weixin.qq.com/wiki/0/56d992c605a97245eb7e617854b169fc.html
:param user_id: 用户 ID
:return: 用户所在分组 ID
使用示例::
from wechatpy import WeChatClient
client = WeChatClient('appid'... | python | def get_group_id(self, user_id):
"""
获取用户所在分组 ID
详情请参考
http://mp.weixin.qq.com/wiki/0/56d992c605a97245eb7e617854b169fc.html
:param user_id: 用户 ID
:return: 用户所在分组 ID
使用示例::
from wechatpy import WeChatClient
client = WeChatClient('appid'... | [
"def",
"get_group_id",
"(",
"self",
",",
"user_id",
")",
":",
"res",
"=",
"self",
".",
"_post",
"(",
"'groups/getid'",
",",
"data",
"=",
"{",
"'openid'",
":",
"user_id",
"}",
",",
"result_processor",
"=",
"lambda",
"x",
":",
"x",
"[",
"'groupid'",
"]",... | 获取用户所在分组 ID
详情请参考
http://mp.weixin.qq.com/wiki/0/56d992c605a97245eb7e617854b169fc.html
:param user_id: 用户 ID
:return: 用户所在分组 ID
使用示例::
from wechatpy import WeChatClient
client = WeChatClient('appid', 'secret')
group_id = client.user.get_gr... | [
"获取用户所在分组",
"ID"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/user.py#L123-L146 | train | Get group id | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/client/api/user.py | WeChatUser.get_batch | def get_batch(self, user_list):
"""
批量获取用户基本信息
开发者可通过该接口来批量获取用户基本信息。最多支持一次拉取100条。
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839
:param user_list: user_list,支持“使用示例”中两种输入格式
:return: 用户信息的 list
使用示例::
from wechatpy i... | python | def get_batch(self, user_list):
"""
批量获取用户基本信息
开发者可通过该接口来批量获取用户基本信息。最多支持一次拉取100条。
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839
:param user_list: user_list,支持“使用示例”中两种输入格式
:return: 用户信息的 list
使用示例::
from wechatpy i... | [
"def",
"get_batch",
"(",
"self",
",",
"user_list",
")",
":",
"if",
"all",
"(",
"(",
"isinstance",
"(",
"x",
",",
"six",
".",
"string_types",
")",
"for",
"x",
"in",
"user_list",
")",
")",
":",
"user_list",
"=",
"[",
"{",
"'openid'",
":",
"oid",
"}",... | 批量获取用户基本信息
开发者可通过该接口来批量获取用户基本信息。最多支持一次拉取100条。
详情请参考
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140839
:param user_list: user_list,支持“使用示例”中两种输入格式
:return: 用户信息的 list
使用示例::
from wechatpy import WeChatClient
client = WeChatClien... | [
"批量获取用户基本信息",
"开发者可通过该接口来批量获取用户基本信息。最多支持一次拉取100条。"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/user.py#L148-L178 | train | Get a list of user_list | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/client/api/user.py | WeChatUser.change_openid | def change_openid(self, from_appid, openid_list):
'''微信公众号主体变更迁移用户 openid
详情请参考
http://kf.qq.com/faq/170221aUnmmU170221eUZJNf.html
:param from_appid: 原公众号的 appid
:param openid_list: 需要转换的openid,这些必须是旧账号目前关注的才行,否则会出错;一次最多100个
:return: 转换后的 openid 信息列表
'''
... | python | def change_openid(self, from_appid, openid_list):
'''微信公众号主体变更迁移用户 openid
详情请参考
http://kf.qq.com/faq/170221aUnmmU170221eUZJNf.html
:param from_appid: 原公众号的 appid
:param openid_list: 需要转换的openid,这些必须是旧账号目前关注的才行,否则会出错;一次最多100个
:return: 转换后的 openid 信息列表
'''
... | [
"def",
"change_openid",
"(",
"self",
",",
"from_appid",
",",
"openid_list",
")",
":",
"return",
"self",
".",
"_post",
"(",
"'changeopenid'",
",",
"data",
"=",
"{",
"'from_appid'",
":",
"from_appid",
",",
"'openid_list'",
":",
"openid_list",
"}",
",",
"result... | 微信公众号主体变更迁移用户 openid
详情请参考
http://kf.qq.com/faq/170221aUnmmU170221eUZJNf.html
:param from_appid: 原公众号的 appid
:param openid_list: 需要转换的openid,这些必须是旧账号目前关注的才行,否则会出错;一次最多100个
:return: 转换后的 openid 信息列表 | [
"微信公众号主体变更迁移用户",
"openid"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/client/api/user.py#L180-L194 | train | Change openid list | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/enterprise/client/api/message.py | WeChatMessage.send | def send(self, agent_id, user_ids, party_ids='',
tag_ids='', msg=None):
"""
通用的消息发送接口。msg 内需要指定 msgtype 和对应类型消息必须的字段。
如果部分接收人无权限或不存在,发送仍然执行,但会返回无效的部分(即invaliduser或invalidparty或invalidtag),常见的原因是接收人不在应用的可见范围内。
user_ids、party_ids、tag_ids 不能同时为空,后面不再强调。
:param agent_id... | python | def send(self, agent_id, user_ids, party_ids='',
tag_ids='', msg=None):
"""
通用的消息发送接口。msg 内需要指定 msgtype 和对应类型消息必须的字段。
如果部分接收人无权限或不存在,发送仍然执行,但会返回无效的部分(即invaliduser或invalidparty或invalidtag),常见的原因是接收人不在应用的可见范围内。
user_ids、party_ids、tag_ids 不能同时为空,后面不再强调。
:param agent_id... | [
"def",
"send",
"(",
"self",
",",
"agent_id",
",",
"user_ids",
",",
"party_ids",
"=",
"''",
",",
"tag_ids",
"=",
"''",
",",
"msg",
"=",
"None",
")",
":",
"msg",
"=",
"msg",
"or",
"{",
"}",
"if",
"isinstance",
"(",
"user_ids",
",",
"(",
"tuple",
",... | 通用的消息发送接口。msg 内需要指定 msgtype 和对应类型消息必须的字段。
如果部分接收人无权限或不存在,发送仍然执行,但会返回无效的部分(即invaliduser或invalidparty或invalidtag),常见的原因是接收人不在应用的可见范围内。
user_ids、party_ids、tag_ids 不能同时为空,后面不再强调。
:param agent_id: 必填,企业应用的id,整型。可在应用的设置页面查看。
:param user_ids: 成员ID列表。
:param party_ids: 部门ID列表。
:... | [
"通用的消息发送接口。msg",
"内需要指定",
"msgtype",
"和对应类型消息必须的字段。",
"如果部分接收人无权限或不存在,发送仍然执行,但会返回无效的部分(即invaliduser或invalidparty或invalidtag),常见的原因是接收人不在应用的可见范围内。",
"user_ids、party_ids、tag_ids",
"不能同时为空,后面不再强调。"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/enterprise/client/api/message.py#L28-L58 | train | Send a message to the specified agent. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/enterprise/client/api/message.py | WeChatMessage.send_text_card | def send_text_card(self, agent_id, user_ids, title, description, url, btntxt='详情',
party_ids='', tag_ids=''):
""" 文本卡片消息
https://work.weixin.qq.com/api/doc#90000/90135/90236/文本卡片消息
请求示例:
{
"touser" : "UserID1|UserID2|UserID3",
"toparty" : "P... | python | def send_text_card(self, agent_id, user_ids, title, description, url, btntxt='详情',
party_ids='', tag_ids=''):
""" 文本卡片消息
https://work.weixin.qq.com/api/doc#90000/90135/90236/文本卡片消息
请求示例:
{
"touser" : "UserID1|UserID2|UserID3",
"toparty" : "P... | [
"def",
"send_text_card",
"(",
"self",
",",
"agent_id",
",",
"user_ids",
",",
"title",
",",
"description",
",",
"url",
",",
"btntxt",
"=",
"'详情',",
"",
"party_ids",
"=",
"''",
",",
"tag_ids",
"=",
"''",
")",
":",
"return",
"self",
".",
"send",
"(",
"a... | 文本卡片消息
https://work.weixin.qq.com/api/doc#90000/90135/90236/文本卡片消息
请求示例:
{
"touser" : "UserID1|UserID2|UserID3",
"toparty" : "PartyID1 | PartyID2",
"totag" : "TagID1 | TagID2",
"msgtype" : "textcard",
"agentid" : 1,
"textcard" :... | [
"文本卡片消息"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/enterprise/client/api/message.py#L74-L124 | train | Send a textcard to the given user_ids. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
jxtech/wechatpy | wechatpy/enterprise/client/api/message.py | WeChatMessage.send_markdown | def send_markdown(self, agent_id, user_ids, content, party_ids='', tag_ids=''):
"""markdown消息
https://work.weixin.qq.com/api/doc#90000/90135/90236/markdown%E6%B6%88%E6%81%AF
> 目前仅支持markdown语法的子集
> 微工作台(原企业号)不支持展示markdown消息
:param agent_id: 企业应用的id,整型。可在应用的设置页面查看
:type ... | python | def send_markdown(self, agent_id, user_ids, content, party_ids='', tag_ids=''):
"""markdown消息
https://work.weixin.qq.com/api/doc#90000/90135/90236/markdown%E6%B6%88%E6%81%AF
> 目前仅支持markdown语法的子集
> 微工作台(原企业号)不支持展示markdown消息
:param agent_id: 企业应用的id,整型。可在应用的设置页面查看
:type ... | [
"def",
"send_markdown",
"(",
"self",
",",
"agent_id",
",",
"user_ids",
",",
"content",
",",
"party_ids",
"=",
"''",
",",
"tag_ids",
"=",
"''",
")",
":",
"msg",
"=",
"{",
"\"msgtype\"",
":",
"\"markdown\"",
",",
"\"markdown\"",
":",
"{",
"\"content\"",
":... | markdown消息
https://work.weixin.qq.com/api/doc#90000/90135/90236/markdown%E6%B6%88%E6%81%AF
> 目前仅支持markdown语法的子集
> 微工作台(原企业号)不支持展示markdown消息
:param agent_id: 企业应用的id,整型。可在应用的设置页面查看
:type agent_id: string
:param content: markdown内容,最长不超过2048个字节,必须是utf8编码
:type co... | [
"markdown消息"
] | 4df0da795618c0895a10f1c2cde9e9d5c0a93aaa | https://github.com/jxtech/wechatpy/blob/4df0da795618c0895a10f1c2cde9e9d5c0a93aaa/wechatpy/enterprise/client/api/message.py#L243-L275 | train | Send markdown to the specified user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/logdensities.py | multivariate_normal | def multivariate_normal(x, mu, L):
"""
Computes the log-density of a multivariate normal.
:param x : Dx1 or DxN sample(s) for which we want the density
:param mu : Dx1 or DxN mean(s) of the normal distribution
:param L : DxD Cholesky decomposition of the covariance matrix
:return p : (1,) or (... | python | def multivariate_normal(x, mu, L):
"""
Computes the log-density of a multivariate normal.
:param x : Dx1 or DxN sample(s) for which we want the density
:param mu : Dx1 or DxN mean(s) of the normal distribution
:param L : DxD Cholesky decomposition of the covariance matrix
:return p : (1,) or (... | [
"def",
"multivariate_normal",
"(",
"x",
",",
"mu",
",",
"L",
")",
":",
"mu_ndims",
"=",
"mu",
".",
"shape",
".",
"ndims",
"x_ndims",
"=",
"x",
".",
"shape",
".",
"ndims",
"if",
"x_ndims",
"is",
"not",
"None",
"and",
"x_ndims",
"!=",
"2",
":",
"rais... | Computes the log-density of a multivariate normal.
:param x : Dx1 or DxN sample(s) for which we want the density
:param mu : Dx1 or DxN mean(s) of the normal distribution
:param L : DxD Cholesky decomposition of the covariance matrix
:return p : (1,) or (N,) vector of log densities for each of the N x... | [
"Computes",
"the",
"log",
"-",
"density",
"of",
"a",
"multivariate",
"normal",
".",
":",
"param",
"x",
":",
"Dx1",
"or",
"DxN",
"sample",
"(",
"s",
")",
"for",
"which",
"we",
"want",
"the",
"density",
":",
"param",
"mu",
":",
"Dx1",
"or",
"DxN",
"m... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/logdensities.py#L73-L101 | train | Computes the log - density of a multivariate normal distribution. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/tensorflow_optimizer.py | _TensorFlowOptimizer.make_optimize_tensor | def make_optimize_tensor(self, model, session=None, var_list=None, **kwargs):
"""
Make Tensorflow optimization tensor.
This method builds optimization tensor and initializes all necessary variables
created by optimizer.
:param model: GPflow model.
:param session:... | python | def make_optimize_tensor(self, model, session=None, var_list=None, **kwargs):
"""
Make Tensorflow optimization tensor.
This method builds optimization tensor and initializes all necessary variables
created by optimizer.
:param model: GPflow model.
:param session:... | [
"def",
"make_optimize_tensor",
"(",
"self",
",",
"model",
",",
"session",
"=",
"None",
",",
"var_list",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"session",
"=",
"model",
".",
"enquire_session",
"(",
"session",
")",
"objective",
"=",
"model",
".",
... | Make Tensorflow optimization tensor.
This method builds optimization tensor and initializes all necessary variables
created by optimizer.
:param model: GPflow model.
:param session: Tensorflow session.
:param var_list: List of variables for training.
:par... | [
"Make",
"Tensorflow",
"optimization",
"tensor",
".",
"This",
"method",
"builds",
"optimization",
"tensor",
"and",
"initializes",
"all",
"necessary",
"variables",
"created",
"by",
"optimizer",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/tensorflow_optimizer.py#L36-L57 | train | This method builds an optimization tensor and initializes all necessary variables. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/tensorflow_optimizer.py | _TensorFlowOptimizer.make_optimize_action | def make_optimize_action(self, model, session=None, var_list=None, **kwargs):
"""
Build Optimization action task with Tensorflow optimizer.
:param model: GPflow model.
:param session: Tensorflow session.
:param var_list: List of Tensorflow variables to train.
... | python | def make_optimize_action(self, model, session=None, var_list=None, **kwargs):
"""
Build Optimization action task with Tensorflow optimizer.
:param model: GPflow model.
:param session: Tensorflow session.
:param var_list: List of Tensorflow variables to train.
... | [
"def",
"make_optimize_action",
"(",
"self",
",",
"model",
",",
"session",
"=",
"None",
",",
"var_list",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"model",
"is",
"None",
"or",
"not",
"isinstance",
"(",
"model",
",",
"Model",
")",
":",
"rai... | Build Optimization action task with Tensorflow optimizer.
:param model: GPflow model.
:param session: Tensorflow session.
:param var_list: List of Tensorflow variables to train.
:param feed_dict: Tensorflow feed_dict dictionary.
:param kwargs: Extra parameter... | [
"Build",
"Optimization",
"action",
"task",
"with",
"Tensorflow",
"optimizer",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/tensorflow_optimizer.py#L59-L82 | train | Build Optimization action task with Tensorflow optimizer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/tensorflow_optimizer.py | _TensorFlowOptimizer.minimize | def minimize(self, model, session=None, var_list=None, feed_dict=None,
maxiter=1000, initialize=False, anchor=True, step_callback=None, **kwargs):
"""
Minimizes objective function of the model.
:param model: GPflow model with objective tensor.
:param session: Session wh... | python | def minimize(self, model, session=None, var_list=None, feed_dict=None,
maxiter=1000, initialize=False, anchor=True, step_callback=None, **kwargs):
"""
Minimizes objective function of the model.
:param model: GPflow model with objective tensor.
:param session: Session wh... | [
"def",
"minimize",
"(",
"self",
",",
"model",
",",
"session",
"=",
"None",
",",
"var_list",
"=",
"None",
",",
"feed_dict",
"=",
"None",
",",
"maxiter",
"=",
"1000",
",",
"initialize",
"=",
"False",
",",
"anchor",
"=",
"True",
",",
"step_callback",
"=",... | Minimizes objective function of the model.
:param model: GPflow model with objective tensor.
:param session: Session where optimization will be run.
:param var_list: List of extra variables which should be trained during optimization.
:param feed_dict: Feed dictionary of tensors passed ... | [
"Minimizes",
"objective",
"function",
"of",
"the",
"model",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/tensorflow_optimizer.py#L84-L124 | train | Minimizes objective function of the model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/session_manager.py | get_session | def get_session(*args, **kwargs):
"""
Pass session configuration options
"""
if 'config' not in kwargs:
kwargs['config'] = tf.ConfigProto(**settings.session)
if settings.profiling.dump_timeline:
def fill_kwargs(key, value):
"""
Internal function for filling de... | python | def get_session(*args, **kwargs):
"""
Pass session configuration options
"""
if 'config' not in kwargs:
kwargs['config'] = tf.ConfigProto(**settings.session)
if settings.profiling.dump_timeline:
def fill_kwargs(key, value):
"""
Internal function for filling de... | [
"def",
"get_session",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'config'",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"'config'",
"]",
"=",
"tf",
".",
"ConfigProto",
"(",
"*",
"*",
"settings",
".",
"session",
")",
"if",
"settings",
... | Pass session configuration options | [
"Pass",
"session",
"configuration",
"options"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/session_manager.py#L106-L127 | train | Returns a tf. Session with the given arguments and kwargs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/session_manager.py | TracerSession._trace_filename | def _trace_filename(self):
"""
Creates trace filename.
"""
dir_stub = ''
if self.output_directory is not None:
dir_stub = self.output_directory
if self.each_time:
filename = '{0}_{1}.json'.format(
self.output_file_name, self.counter... | python | def _trace_filename(self):
"""
Creates trace filename.
"""
dir_stub = ''
if self.output_directory is not None:
dir_stub = self.output_directory
if self.each_time:
filename = '{0}_{1}.json'.format(
self.output_file_name, self.counter... | [
"def",
"_trace_filename",
"(",
"self",
")",
":",
"dir_stub",
"=",
"''",
"if",
"self",
".",
"output_directory",
"is",
"not",
"None",
":",
"dir_stub",
"=",
"self",
".",
"output_directory",
"if",
"self",
".",
"each_time",
":",
"filename",
"=",
"'{0}_{1}.json'",... | Creates trace filename. | [
"Creates",
"trace",
"filename",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/session_manager.py#L50-L62 | train | Creates trace filename. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/scipy_optimizer.py | ScipyOptimizer.make_optimize_tensor | def make_optimize_tensor(self, model, session=None, var_list=None, **kwargs):
"""
Make SciPy optimization tensor.
The `make_optimize_tensor` method builds optimization tensor and initializes
all necessary variables created by optimizer.
:param model: GPflow model.
... | python | def make_optimize_tensor(self, model, session=None, var_list=None, **kwargs):
"""
Make SciPy optimization tensor.
The `make_optimize_tensor` method builds optimization tensor and initializes
all necessary variables created by optimizer.
:param model: GPflow model.
... | [
"def",
"make_optimize_tensor",
"(",
"self",
",",
"model",
",",
"session",
"=",
"None",
",",
"var_list",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"session",
"=",
"model",
".",
"enquire_session",
"(",
"session",
")",
"with",
"session",
".",
"as_defa... | Make SciPy optimization tensor.
The `make_optimize_tensor` method builds optimization tensor and initializes
all necessary variables created by optimizer.
:param model: GPflow model.
:param session: Tensorflow session.
:param var_list: List of variables for training.... | [
"Make",
"SciPy",
"optimization",
"tensor",
".",
"The",
"make_optimize_tensor",
"method",
"builds",
"optimization",
"tensor",
"and",
"initializes",
"all",
"necessary",
"variables",
"created",
"by",
"optimizer",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/scipy_optimizer.py#L27-L52 | train | This method builds an optimization tensor and initializes it with the given model and session. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/scipy_optimizer.py | ScipyOptimizer.minimize | def minimize(self, model, session=None, var_list=None, feed_dict=None, maxiter=1000,
disp=False, initialize=False, anchor=True, step_callback=None, **kwargs):
"""
Minimizes objective function of the model.
:param model: GPflow model with objective tensor.
:param session... | python | def minimize(self, model, session=None, var_list=None, feed_dict=None, maxiter=1000,
disp=False, initialize=False, anchor=True, step_callback=None, **kwargs):
"""
Minimizes objective function of the model.
:param model: GPflow model with objective tensor.
:param session... | [
"def",
"minimize",
"(",
"self",
",",
"model",
",",
"session",
"=",
"None",
",",
"var_list",
"=",
"None",
",",
"feed_dict",
"=",
"None",
",",
"maxiter",
"=",
"1000",
",",
"disp",
"=",
"False",
",",
"initialize",
"=",
"False",
",",
"anchor",
"=",
"True... | Minimizes objective function of the model.
:param model: GPflow model with objective tensor.
:param session: Session where optimization will be run.
:param var_list: List of extra variables which should be trained during optimization.
:param feed_dict: Feed dictionary of tensors passed ... | [
"Minimizes",
"objective",
"function",
"of",
"the",
"model",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/scipy_optimizer.py#L54-L91 | train | Minimizes objective function of the model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/gpmc.py | GPMC.compile | def compile(self, session=None):
"""
Before calling the standard compile function, check to see if the size
of the data has changed and add parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data.
"""
if no... | python | def compile(self, session=None):
"""
Before calling the standard compile function, check to see if the size
of the data has changed and add parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data.
"""
if no... | [
"def",
"compile",
"(",
"self",
",",
"session",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"num_data",
"==",
"self",
".",
"X",
".",
"shape",
"[",
"0",
"]",
":",
"self",
".",
"num_data",
"=",
"self",
".",
"X",
".",
"shape",
"[",
"0",
"]",
... | Before calling the standard compile function, check to see if the size
of the data has changed and add parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data. | [
"Before",
"calling",
"the",
"standard",
"compile",
"function",
"check",
"to",
"see",
"if",
"the",
"size",
"of",
"the",
"data",
"has",
"changed",
"and",
"add",
"parameters",
"appropriately",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/gpmc.py#L57-L70 | train | Compile the GPMC into a dictionary of parameters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/gpmc.py | GPMC._build_likelihood | def _build_likelihood(self):
r"""
Construct a tf function to compute the likelihood of a general GP
model.
\log p(Y, V | theta).
"""
K = self.kern.K(self.X)
L = tf.cholesky(
K + tf.eye(tf.shape(self.X)[0], dtype=settings.float_type) * settings.nu... | python | def _build_likelihood(self):
r"""
Construct a tf function to compute the likelihood of a general GP
model.
\log p(Y, V | theta).
"""
K = self.kern.K(self.X)
L = tf.cholesky(
K + tf.eye(tf.shape(self.X)[0], dtype=settings.float_type) * settings.nu... | [
"def",
"_build_likelihood",
"(",
"self",
")",
":",
"K",
"=",
"self",
".",
"kern",
".",
"K",
"(",
"self",
".",
"X",
")",
"L",
"=",
"tf",
".",
"cholesky",
"(",
"K",
"+",
"tf",
".",
"eye",
"(",
"tf",
".",
"shape",
"(",
"self",
".",
"X",
")",
"... | r"""
Construct a tf function to compute the likelihood of a general GP
model.
\log p(Y, V | theta). | [
"r",
"Construct",
"a",
"tf",
"function",
"to",
"compute",
"the",
"likelihood",
"of",
"a",
"general",
"GP",
"model",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/gpmc.py#L73-L86 | train | r Construct a tf function to compute the likelihood of a general GP
model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/gpmc.py | GPMC._build_predict | def _build_predict(self, Xnew, full_cov=False):
"""
Xnew is a data matrix, point at which we want to predict
This method computes
p(F* | (F=LV) )
where F* are points on the GP at Xnew, F=LV are points on the GP at X.
"""
mu, var = conditional(Xnew, self.X,... | python | def _build_predict(self, Xnew, full_cov=False):
"""
Xnew is a data matrix, point at which we want to predict
This method computes
p(F* | (F=LV) )
where F* are points on the GP at Xnew, F=LV are points on the GP at X.
"""
mu, var = conditional(Xnew, self.X,... | [
"def",
"_build_predict",
"(",
"self",
",",
"Xnew",
",",
"full_cov",
"=",
"False",
")",
":",
"mu",
",",
"var",
"=",
"conditional",
"(",
"Xnew",
",",
"self",
".",
"X",
",",
"self",
".",
"kern",
",",
"self",
".",
"V",
",",
"full_cov",
"=",
"full_cov",... | Xnew is a data matrix, point at which we want to predict
This method computes
p(F* | (F=LV) )
where F* are points on the GP at Xnew, F=LV are points on the GP at X. | [
"Xnew",
"is",
"a",
"data",
"matrix",
"point",
"at",
"which",
"we",
"want",
"to",
"predict"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/gpmc.py#L89-L103 | train | Builds the predict function for the new set of entries in the cluster. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/svgp.py | SVGP._init_variational_parameters | def _init_variational_parameters(self, num_inducing, q_mu, q_sqrt, q_diag):
"""
Constructs the mean and cholesky of the covariance of the variational Gaussian posterior.
If a user passes values for `q_mu` and `q_sqrt` the routine checks if they have consistent
and correct shapes. If a us... | python | def _init_variational_parameters(self, num_inducing, q_mu, q_sqrt, q_diag):
"""
Constructs the mean and cholesky of the covariance of the variational Gaussian posterior.
If a user passes values for `q_mu` and `q_sqrt` the routine checks if they have consistent
and correct shapes. If a us... | [
"def",
"_init_variational_parameters",
"(",
"self",
",",
"num_inducing",
",",
"q_mu",
",",
"q_sqrt",
",",
"q_diag",
")",
":",
"q_mu",
"=",
"np",
".",
"zeros",
"(",
"(",
"num_inducing",
",",
"self",
".",
"num_latent",
")",
")",
"if",
"q_mu",
"is",
"None",... | Constructs the mean and cholesky of the covariance of the variational Gaussian posterior.
If a user passes values for `q_mu` and `q_sqrt` the routine checks if they have consistent
and correct shapes. If a user does not specify any values for `q_mu` and `q_sqrt`, the routine
initializes them, th... | [
"Constructs",
"the",
"mean",
"and",
"cholesky",
"of",
"the",
"covariance",
"of",
"the",
"variational",
"Gaussian",
"posterior",
".",
"If",
"a",
"user",
"passes",
"values",
"for",
"q_mu",
"and",
"q_sqrt",
"the",
"routine",
"checks",
"if",
"they",
"have",
"con... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/svgp.py#L90-L137 | train | Initializes the variational parameters for the current class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/svgp.py | SVGP._build_likelihood | def _build_likelihood(self):
"""
This gives a variational bound on the model likelihood.
"""
# Get prior KL.
KL = self.build_prior_KL()
# Get conditionals
fmean, fvar = self._build_predict(self.X, full_cov=False, full_output_cov=False)
# Get variational... | python | def _build_likelihood(self):
"""
This gives a variational bound on the model likelihood.
"""
# Get prior KL.
KL = self.build_prior_KL()
# Get conditionals
fmean, fvar = self._build_predict(self.X, full_cov=False, full_output_cov=False)
# Get variational... | [
"def",
"_build_likelihood",
"(",
"self",
")",
":",
"# Get prior KL.",
"KL",
"=",
"self",
".",
"build_prior_KL",
"(",
")",
"# Get conditionals",
"fmean",
",",
"fvar",
"=",
"self",
".",
"_build_predict",
"(",
"self",
".",
"X",
",",
"full_cov",
"=",
"False",
... | This gives a variational bound on the model likelihood. | [
"This",
"gives",
"a",
"variational",
"bound",
"on",
"the",
"model",
"likelihood",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/svgp.py#L149-L166 | train | Build the likelihood for the current model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/node.py | Node.compile | def compile(self, session=None):
"""
Compile is two phase operation: at first it calls `build` method and then
intializes the node for passed session. The policy around `session` is defined
inside the `initialize` method.
:param session: TensorFlow session used for initializing.... | python | def compile(self, session=None):
"""
Compile is two phase operation: at first it calls `build` method and then
intializes the node for passed session. The policy around `session` is defined
inside the `initialize` method.
:param session: TensorFlow session used for initializing.... | [
"def",
"compile",
"(",
"self",
",",
"session",
"=",
"None",
")",
":",
"session",
"=",
"self",
".",
"enquire_session",
"(",
"session",
")",
"if",
"self",
".",
"is_built_coherence",
"(",
"session",
".",
"graph",
")",
"is",
"Build",
".",
"NO",
":",
"with"... | Compile is two phase operation: at first it calls `build` method and then
intializes the node for passed session. The policy around `session` is defined
inside the `initialize` method.
:param session: TensorFlow session used for initializing. If the node is built the
session's graph... | [
"Compile",
"is",
"two",
"phase",
"operation",
":",
"at",
"first",
"it",
"calls",
"build",
"method",
"and",
"then",
"intializes",
"the",
"node",
"for",
"passed",
"session",
".",
"The",
"policy",
"around",
"session",
"is",
"defined",
"inside",
"the",
"initiali... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/node.py#L43-L59 | train | This method compiles the node for the passed session. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/node.py | Node.initialize | def initialize(self, session=None, force=False):
"""
Initializes TensorFlow variables, which are returned by `initializables` property and
uses feed dictionary returned by `initializable_feeds` property defined at ICompilable
interface and implemented by descendants.
:param sess... | python | def initialize(self, session=None, force=False):
"""
Initializes TensorFlow variables, which are returned by `initializables` property and
uses feed dictionary returned by `initializable_feeds` property defined at ICompilable
interface and implemented by descendants.
:param sess... | [
"def",
"initialize",
"(",
"self",
",",
"session",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"session",
"=",
"self",
".",
"enquire_session",
"(",
"session",
")",
"initializables",
"=",
"self",
".",
"initializables",
"if",
"initializables",
":",
"mi... | Initializes TensorFlow variables, which are returned by `initializables` property and
uses feed dictionary returned by `initializable_feeds` property defined at ICompilable
interface and implemented by descendants.
:param session: TensorFlow session used for initializing. In case when session i... | [
"Initializes",
"TensorFlow",
"variables",
"which",
"are",
"returned",
"by",
"initializables",
"property",
"and",
"uses",
"feed",
"dictionary",
"returned",
"by",
"initializable_feeds",
"property",
"defined",
"at",
"ICompilable",
"interface",
"and",
"implemented",
"by",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/node.py#L61-L84 | train | Initializes TensorFlow variables which are returned by initializables property and uses feed dictionary returned by initializable_feeds property. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/node.py | Node.clear | def clear(self):
"""
Calls `_clear` abstract method which must be implemented by descendants.
:raises: GPflowError exception when parent of the node is built.
"""
parent = self.parent
if parent is not self and parent.is_built_coherence(self.graph) is Build.YES:
... | python | def clear(self):
"""
Calls `_clear` abstract method which must be implemented by descendants.
:raises: GPflowError exception when parent of the node is built.
"""
parent = self.parent
if parent is not self and parent.is_built_coherence(self.graph) is Build.YES:
... | [
"def",
"clear",
"(",
"self",
")",
":",
"parent",
"=",
"self",
".",
"parent",
"if",
"parent",
"is",
"not",
"self",
"and",
"parent",
".",
"is_built_coherence",
"(",
"self",
".",
"graph",
")",
"is",
"Build",
".",
"YES",
":",
"raise",
"GPflowError",
"(",
... | Calls `_clear` abstract method which must be implemented by descendants.
:raises: GPflowError exception when parent of the node is built. | [
"Calls",
"_clear",
"abstract",
"method",
"which",
"must",
"be",
"implemented",
"by",
"descendants",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/node.py#L86-L95 | train | Calls _clear abstract method which must be implemented by descendants. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/node.py | Node.enquire_graph | def enquire_graph(self, graph=None):
"""
Verifies and returns relevant TensorFlow graph. If non-None graph were passed,
the same graph is returned. Otherwise, nodes's graph is exposed and it is
undefined the default TensorFlow graph is used.
:param graph: TensorFlow graph or Non... | python | def enquire_graph(self, graph=None):
"""
Verifies and returns relevant TensorFlow graph. If non-None graph were passed,
the same graph is returned. Otherwise, nodes's graph is exposed and it is
undefined the default TensorFlow graph is used.
:param graph: TensorFlow graph or Non... | [
"def",
"enquire_graph",
"(",
"self",
",",
"graph",
"=",
"None",
")",
":",
"if",
"graph",
"is",
"None",
":",
"graph",
"=",
"self",
".",
"root",
".",
"graph",
"if",
"self",
".",
"graph",
"is",
"None",
"else",
"self",
".",
"graph",
"if",
"graph",
"is"... | Verifies and returns relevant TensorFlow graph. If non-None graph were passed,
the same graph is returned. Otherwise, nodes's graph is exposed and it is
undefined the default TensorFlow graph is used.
:param graph: TensorFlow graph or None. Default is None.
:return: TensorFlow graph. | [
"Verifies",
"and",
"returns",
"relevant",
"TensorFlow",
"graph",
".",
"If",
"non",
"-",
"None",
"graph",
"were",
"passed",
"the",
"same",
"graph",
"is",
"returned",
".",
"Otherwise",
"nodes",
"s",
"graph",
"is",
"exposed",
"and",
"it",
"is",
"undefined",
"... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/node.py#L97-L110 | train | Verifies and returns relevant TensorFlow graph. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/node.py | Node.enquire_session | def enquire_session(self, session=None):
"""
Verifies and returns relevant TensorFlow session. If non-None session
were passed, session is checked for graph compliance and returned back.
Otherwise, default TensorFlow session is returned. When TensorFlow default
session is not set... | python | def enquire_session(self, session=None):
"""
Verifies and returns relevant TensorFlow session. If non-None session
were passed, session is checked for graph compliance and returned back.
Otherwise, default TensorFlow session is returned. When TensorFlow default
session is not set... | [
"def",
"enquire_session",
"(",
"self",
",",
"session",
"=",
"None",
")",
":",
"if",
"session",
"is",
"None",
":",
"session",
"=",
"tf",
".",
"get_default_session",
"(",
")",
"if",
"session",
"is",
"None",
":",
"session",
"=",
"session_manager",
".",
"get... | Verifies and returns relevant TensorFlow session. If non-None session
were passed, session is checked for graph compliance and returned back.
Otherwise, default TensorFlow session is returned. When TensorFlow default
session is not set up, GPflow session's manager creates or uses existing
... | [
"Verifies",
"and",
"returns",
"relevant",
"TensorFlow",
"session",
".",
"If",
"non",
"-",
"None",
"session",
"were",
"passed",
"session",
"is",
"checked",
"for",
"graph",
"compliance",
"and",
"returned",
"back",
".",
"Otherwise",
"default",
"TensorFlow",
"sessio... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/node.py#L112-L129 | train | Ensures and returns relevant TensorFlow session. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/node.py | Node.is_built_coherence | def is_built_coherence(self, graph=None):
"""
Checks that node was build using input `graph`.
:return: `Build` status.
:raises GPflowError: Valid passed TensorFlow graph is different from
used graph in node.
"""
graph = self.enquire_graph(graph=graph)
... | python | def is_built_coherence(self, graph=None):
"""
Checks that node was build using input `graph`.
:return: `Build` status.
:raises GPflowError: Valid passed TensorFlow graph is different from
used graph in node.
"""
graph = self.enquire_graph(graph=graph)
... | [
"def",
"is_built_coherence",
"(",
"self",
",",
"graph",
"=",
"None",
")",
":",
"graph",
"=",
"self",
".",
"enquire_graph",
"(",
"graph",
"=",
"graph",
")",
"is_built",
"=",
"self",
".",
"is_built",
"(",
"graph",
")",
"if",
"is_built",
"is",
"Build",
".... | Checks that node was build using input `graph`.
:return: `Build` status.
:raises GPflowError: Valid passed TensorFlow graph is different from
used graph in node. | [
"Checks",
"that",
"node",
"was",
"build",
"using",
"input",
"graph",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/node.py#L131-L143 | train | Checks that node was built using input graph. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/node.py | Node.build | def build(self):
"""
Implementation for ICompilable interface `build` method. Builds tensors within
TensorFlow name scope using parentable node's name. Hidden name is used when
no parent exists for current node.
:raises GPflowError: Node's parts were built with different graph ... | python | def build(self):
"""
Implementation for ICompilable interface `build` method. Builds tensors within
TensorFlow name scope using parentable node's name. Hidden name is used when
no parent exists for current node.
:raises GPflowError: Node's parts were built with different graph ... | [
"def",
"build",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_built_coherence",
"(",
")",
"is",
"Build",
".",
"NO",
":",
"with",
"tf",
".",
"name_scope",
"(",
"self",
".",
"tf_name_scope",
")",
":",
"self",
".",
"_build",
"(",
")"
] | Implementation for ICompilable interface `build` method. Builds tensors within
TensorFlow name scope using parentable node's name. Hidden name is used when
no parent exists for current node.
:raises GPflowError: Node's parts were built with different graph and differ from
default T... | [
"Implementation",
"for",
"ICompilable",
"interface",
"build",
"method",
".",
"Builds",
"tensors",
"within",
"TensorFlow",
"name",
"scope",
"using",
"parentable",
"node",
"s",
"name",
".",
"Hidden",
"name",
"is",
"used",
"when",
"no",
"parent",
"exists",
"for",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/node.py#L145-L156 | train | Implementation for ICompilable interface build method. Builds tensors within the current node s name scope using parentable node s name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/node.py | Node.tf_name_scope | def tf_name_scope(self):
"""
Auxilary method for composing gpflow's tree name scopes. The Parentable pathname
can be considered as a set of name scopes. This method grabs `pathname` and
returns only name of the node in that path.
Leading node name is always replaced with two part... | python | def tf_name_scope(self):
"""
Auxilary method for composing gpflow's tree name scopes. The Parentable pathname
can be considered as a set of name scopes. This method grabs `pathname` and
returns only name of the node in that path.
Leading node name is always replaced with two part... | [
"def",
"tf_name_scope",
"(",
"self",
")",
":",
"if",
"self",
".",
"parent",
"is",
"self",
":",
"leader_name",
"=",
"self",
".",
"name",
"leader_index",
"=",
"self",
".",
"index",
"if",
"leader_index",
"is",
"None",
":",
"return",
"leader_name",
"return",
... | Auxilary method for composing gpflow's tree name scopes. The Parentable pathname
can be considered as a set of name scopes. This method grabs `pathname` and
returns only name of the node in that path.
Leading node name is always replaced with two parts: the name and the index
for uniquin... | [
"Auxilary",
"method",
"for",
"composing",
"gpflow",
"s",
"tree",
"name",
"scopes",
".",
"The",
"Parentable",
"pathname",
"can",
"be",
"considered",
"as",
"a",
"set",
"of",
"name",
"scopes",
".",
"This",
"method",
"grabs",
"pathname",
"and",
"returns",
"only"... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/node.py#L159-L173 | train | Auxilary method for composing the tree name scopes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/node.py | Node.tf_pathname | def tf_pathname(self):
"""
Method used for defining full path name for particular tensor at build time.
For example, `tf.get_variable` creates variable w/o taking into account
name scopes and `tf_pathname` consists of all parts of scope names
which were used up to that point - `t... | python | def tf_pathname(self):
"""
Method used for defining full path name for particular tensor at build time.
For example, `tf.get_variable` creates variable w/o taking into account
name scopes and `tf_pathname` consists of all parts of scope names
which were used up to that point - `t... | [
"def",
"tf_pathname",
"(",
"self",
")",
":",
"if",
"self",
".",
"parent",
"is",
"self",
":",
"return",
"self",
".",
"tf_name_scope",
"tail",
"=",
"self",
".",
"pathname",
".",
"split",
"(",
"'/'",
",",
"1",
")",
"[",
"-",
"1",
"]",
"leader",
"=",
... | Method used for defining full path name for particular tensor at build time.
For example, `tf.get_variable` creates variable w/o taking into account
name scopes and `tf_pathname` consists of all parts of scope names
which were used up to that point - `tf.get_variable` call. | [
"Method",
"used",
"for",
"defining",
"full",
"path",
"name",
"for",
"particular",
"tensor",
"at",
"build",
"time",
".",
"For",
"example",
"tf",
".",
"get_variable",
"creates",
"variable",
"w",
"/",
"o",
"taking",
"into",
"account",
"name",
"scopes",
"and",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/node.py#L176-L187 | train | Returns the full path name for this tensor at build time. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/compilable.py | autobuild_decorate | def autobuild_decorate(func, caller):
"""
autobuild_decorate(func, caller) decorates a function using a caller.
Allows for an extra `autobuild` keyword arg.
The only difference to decorator.decorate() is to use our custom AutobuildFunctionMaker instead.
"""
evaldict = dict(_call_=caller, _func_=... | python | def autobuild_decorate(func, caller):
"""
autobuild_decorate(func, caller) decorates a function using a caller.
Allows for an extra `autobuild` keyword arg.
The only difference to decorator.decorate() is to use our custom AutobuildFunctionMaker instead.
"""
evaldict = dict(_call_=caller, _func_=... | [
"def",
"autobuild_decorate",
"(",
"func",
",",
"caller",
")",
":",
"evaldict",
"=",
"dict",
"(",
"_call_",
"=",
"caller",
",",
"_func_",
"=",
"func",
")",
"fun",
"=",
"AutobuildFunctionMaker",
".",
"create",
"(",
"func",
",",
"\"return _call_(_func_, %(shortsi... | autobuild_decorate(func, caller) decorates a function using a caller.
Allows for an extra `autobuild` keyword arg.
The only difference to decorator.decorate() is to use our custom AutobuildFunctionMaker instead. | [
"autobuild_decorate",
"(",
"func",
"caller",
")",
"decorates",
"a",
"function",
"using",
"a",
"caller",
".",
"Allows",
"for",
"an",
"extra",
"autobuild",
"keyword",
"arg",
".",
"The",
"only",
"difference",
"to",
"decorator",
".",
"decorate",
"()",
"is",
"to"... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/compilable.py#L84-L96 | train | Decorates a function using a caller. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/params/parameterized.py | Parameterized._build_prior | def _build_prior(self, prior_tensors):
"""
Build a tf expression for the prior by summing all child-parameter priors.
"""
# TODO(@awav): What prior must represent empty list of parameters?
if not prior_tensors:
return tf.constant(0, dtype=settings.float_type)
... | python | def _build_prior(self, prior_tensors):
"""
Build a tf expression for the prior by summing all child-parameter priors.
"""
# TODO(@awav): What prior must represent empty list of parameters?
if not prior_tensors:
return tf.constant(0, dtype=settings.float_type)
... | [
"def",
"_build_prior",
"(",
"self",
",",
"prior_tensors",
")",
":",
"# TODO(@awav): What prior must represent empty list of parameters?",
"if",
"not",
"prior_tensors",
":",
"return",
"tf",
".",
"constant",
"(",
"0",
",",
"dtype",
"=",
"settings",
".",
"float_type",
... | Build a tf expression for the prior by summing all child-parameter priors. | [
"Build",
"a",
"tf",
"expression",
"for",
"the",
"prior",
"by",
"summing",
"all",
"child",
"-",
"parameter",
"priors",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/params/parameterized.py#L304-L311 | train | Builds a tf expression for the prior by summing all child - parameter priors. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | _broadcasting_elementwise_op | def _broadcasting_elementwise_op(op, a, b):
r"""
Apply binary operation `op` to every pair in tensors `a` and `b`.
:param op: binary operator on tensors, e.g. tf.add, tf.substract
:param a: tf.Tensor, shape [n_1, ..., n_a]
:param b: tf.Tensor, shape [m_1, ..., m_b]
:return: tf.Tensor, shape [n_1... | python | def _broadcasting_elementwise_op(op, a, b):
r"""
Apply binary operation `op` to every pair in tensors `a` and `b`.
:param op: binary operator on tensors, e.g. tf.add, tf.substract
:param a: tf.Tensor, shape [n_1, ..., n_a]
:param b: tf.Tensor, shape [m_1, ..., m_b]
:return: tf.Tensor, shape [n_1... | [
"def",
"_broadcasting_elementwise_op",
"(",
"op",
",",
"a",
",",
"b",
")",
":",
"flatres",
"=",
"op",
"(",
"tf",
".",
"reshape",
"(",
"a",
",",
"[",
"-",
"1",
",",
"1",
"]",
")",
",",
"tf",
".",
"reshape",
"(",
"b",
",",
"[",
"1",
",",
"-",
... | r"""
Apply binary operation `op` to every pair in tensors `a` and `b`.
:param op: binary operator on tensors, e.g. tf.add, tf.substract
:param a: tf.Tensor, shape [n_1, ..., n_a]
:param b: tf.Tensor, shape [m_1, ..., m_b]
:return: tf.Tensor, shape [n_1, ..., n_a, m_1, ..., m_b] | [
"r",
"Apply",
"binary",
"operation",
"op",
"to",
"every",
"pair",
"in",
"tensors",
"a",
"and",
"b",
".",
":",
"param",
"op",
":",
"binary",
"operator",
"on",
"tensors",
"e",
".",
"g",
".",
"tf",
".",
"add",
"tf",
".",
"substract",
":",
"param",
"a"... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L846-L855 | train | r Apply binary operation op to every pair in tensors a and b. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | make_deprecated_class | def make_deprecated_class(oldname, NewClass):
"""
Returns a class that raises NotImplementedError on instantiation.
e.g.:
>>> Kern = make_deprecated_class("Kern", Kernel)
"""
msg = ("{module}.{} has been renamed to {module}.{}"
.format(oldname, NewClass.__name__, module=NewClass.__mod... | python | def make_deprecated_class(oldname, NewClass):
"""
Returns a class that raises NotImplementedError on instantiation.
e.g.:
>>> Kern = make_deprecated_class("Kern", Kernel)
"""
msg = ("{module}.{} has been renamed to {module}.{}"
.format(oldname, NewClass.__name__, module=NewClass.__mod... | [
"def",
"make_deprecated_class",
"(",
"oldname",
",",
"NewClass",
")",
":",
"msg",
"=",
"(",
"\"{module}.{} has been renamed to {module}.{}\"",
".",
"format",
"(",
"oldname",
",",
"NewClass",
".",
"__name__",
",",
"module",
"=",
"NewClass",
".",
"__module__",
")",
... | Returns a class that raises NotImplementedError on instantiation.
e.g.:
>>> Kern = make_deprecated_class("Kern", Kernel) | [
"Returns",
"a",
"class",
"that",
"raises",
"NotImplementedError",
"on",
"instantiation",
".",
"e",
".",
"g",
".",
":",
">>>",
"Kern",
"=",
"make_deprecated_class",
"(",
"Kern",
"Kernel",
")"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L858-L872 | train | Returns a class that raises NotImplementedError on instantiation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | Kernel._validate_ard_shape | def _validate_ard_shape(self, name, value, ARD=None):
"""
Validates the shape of a potentially ARD hyperparameter
:param name: The name of the parameter (used for error messages)
:param value: A scalar or an array.
:param ARD: None, False, or True. If None, infers ARD from shape... | python | def _validate_ard_shape(self, name, value, ARD=None):
"""
Validates the shape of a potentially ARD hyperparameter
:param name: The name of the parameter (used for error messages)
:param value: A scalar or an array.
:param ARD: None, False, or True. If None, infers ARD from shape... | [
"def",
"_validate_ard_shape",
"(",
"self",
",",
"name",
",",
"value",
",",
"ARD",
"=",
"None",
")",
":",
"if",
"ARD",
"is",
"None",
":",
"ARD",
"=",
"np",
".",
"asarray",
"(",
"value",
")",
".",
"squeeze",
"(",
")",
".",
"shape",
"!=",
"(",
")",
... | Validates the shape of a potentially ARD hyperparameter
:param name: The name of the parameter (used for error messages)
:param value: A scalar or an array.
:param ARD: None, False, or True. If None, infers ARD from shape of value.
:return: Tuple (value, ARD), where _value_ is a scalar ... | [
"Validates",
"the",
"shape",
"of",
"a",
"potentially",
"ARD",
"hyperparameter"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L68-L93 | train | Validates the shape of an ARD hyperparameter. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | Kernel.on_separate_dims | def on_separate_dims(self, other_kernel):
"""
Checks if the dimensions, over which the kernels are specified, overlap.
Returns True if they are defined on different/separate dimensions and False otherwise.
"""
if isinstance(self.active_dims, slice) or isinstance(other_kernel.acti... | python | def on_separate_dims(self, other_kernel):
"""
Checks if the dimensions, over which the kernels are specified, overlap.
Returns True if they are defined on different/separate dimensions and False otherwise.
"""
if isinstance(self.active_dims, slice) or isinstance(other_kernel.acti... | [
"def",
"on_separate_dims",
"(",
"self",
",",
"other_kernel",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"active_dims",
",",
"slice",
")",
"or",
"isinstance",
"(",
"other_kernel",
".",
"active_dims",
",",
"slice",
")",
":",
"# Be very conservative for kernel... | Checks if the dimensions, over which the kernels are specified, overlap.
Returns True if they are defined on different/separate dimensions and False otherwise. | [
"Checks",
"if",
"the",
"dimensions",
"over",
"which",
"the",
"kernels",
"are",
"specified",
"overlap",
".",
"Returns",
"True",
"if",
"they",
"are",
"defined",
"on",
"different",
"/",
"separate",
"dimensions",
"and",
"False",
"otherwise",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L108-L120 | train | Checks if the kernels defined on different dimensions overlap. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | Kernel._slice | def _slice(self, X, X2):
"""
Slice the correct dimensions for use in the kernel, as indicated by
`self.active_dims`.
:param X: Input 1 (NxD).
:param X2: Input 2 (MxD), may be None.
:return: Sliced X, X2, (Nxself.input_dim).
"""
if isinstance(self.active_di... | python | def _slice(self, X, X2):
"""
Slice the correct dimensions for use in the kernel, as indicated by
`self.active_dims`.
:param X: Input 1 (NxD).
:param X2: Input 2 (MxD), may be None.
:return: Sliced X, X2, (Nxself.input_dim).
"""
if isinstance(self.active_di... | [
"def",
"_slice",
"(",
"self",
",",
"X",
",",
"X2",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"active_dims",
",",
"slice",
")",
":",
"X",
"=",
"X",
"[",
"...",
",",
"self",
".",
"active_dims",
"]",
"if",
"X2",
"is",
"not",
"None",
":",
"X2... | Slice the correct dimensions for use in the kernel, as indicated by
`self.active_dims`.
:param X: Input 1 (NxD).
:param X2: Input 2 (MxD), may be None.
:return: Sliced X, X2, (Nxself.input_dim). | [
"Slice",
"the",
"correct",
"dimensions",
"for",
"use",
"in",
"the",
"kernel",
"as",
"indicated",
"by",
"self",
".",
"active_dims",
".",
":",
"param",
"X",
":",
"Input",
"1",
"(",
"NxD",
")",
".",
":",
"param",
"X2",
":",
"Input",
"2",
"(",
"MxD",
"... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L122-L144 | train | Slice the correct dimensions for use in the kernel. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | Kernel._slice_cov | def _slice_cov(self, cov):
"""
Slice the correct dimensions for use in the kernel, as indicated by
`self.active_dims` for covariance matrices. This requires slicing the
rows *and* columns. This will also turn flattened diagonal
matrices into a tensor of full diagonal matrices.
... | python | def _slice_cov(self, cov):
"""
Slice the correct dimensions for use in the kernel, as indicated by
`self.active_dims` for covariance matrices. This requires slicing the
rows *and* columns. This will also turn flattened diagonal
matrices into a tensor of full diagonal matrices.
... | [
"def",
"_slice_cov",
"(",
"self",
",",
"cov",
")",
":",
"cov",
"=",
"tf",
".",
"cond",
"(",
"tf",
".",
"equal",
"(",
"tf",
".",
"rank",
"(",
"cov",
")",
",",
"2",
")",
",",
"lambda",
":",
"tf",
".",
"matrix_diag",
"(",
"cov",
")",
",",
"lambd... | Slice the correct dimensions for use in the kernel, as indicated by
`self.active_dims` for covariance matrices. This requires slicing the
rows *and* columns. This will also turn flattened diagonal
matrices into a tensor of full diagonal matrices.
:param cov: Tensor of covariance matrices... | [
"Slice",
"the",
"correct",
"dimensions",
"for",
"use",
"in",
"the",
"kernel",
"as",
"indicated",
"by",
"self",
".",
"active_dims",
"for",
"covariance",
"matrices",
".",
"This",
"requires",
"slicing",
"the",
"rows",
"*",
"and",
"*",
"columns",
".",
"This",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L146-L166 | train | Slice the correct dimensions for use in the kernel for use in the kernel. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | Stationary._scaled_square_dist | def _scaled_square_dist(self, X, X2):
"""
Returns ((X - X2ᵀ)/lengthscales)².
Due to the implementation and floating-point imprecision, the
result may actually be very slightly negative for entries very
close to each other.
This function can deal with leading dimensions i... | python | def _scaled_square_dist(self, X, X2):
"""
Returns ((X - X2ᵀ)/lengthscales)².
Due to the implementation and floating-point imprecision, the
result may actually be very slightly negative for entries very
close to each other.
This function can deal with leading dimensions i... | [
"def",
"_scaled_square_dist",
"(",
"self",
",",
"X",
",",
"X2",
")",
":",
"X",
"=",
"X",
"/",
"self",
".",
"lengthscales",
"if",
"X2",
"is",
"None",
":",
"Xs",
"=",
"tf",
".",
"reduce_sum",
"(",
"tf",
".",
"square",
"(",
"X",
")",
",",
"axis",
... | Returns ((X - X2ᵀ)/lengthscales)².
Due to the implementation and floating-point imprecision, the
result may actually be very slightly negative for entries very
close to each other.
This function can deal with leading dimensions in X and X2.
In the sample case, where X and X2 ar... | [
"Returns",
"((",
"X",
"-",
"X2ᵀ",
")",
"/",
"lengthscales",
")",
"²",
".",
"Due",
"to",
"the",
"implementation",
"and",
"floating",
"-",
"point",
"imprecision",
"the",
"result",
"may",
"actually",
"be",
"very",
"slightly",
"negative",
"for",
"entries",
"ve... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L275-L302 | train | Returns the scaled square distance between two sets of entries. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | Stationary.scaled_euclid_dist | def scaled_euclid_dist(self, X, X2): # pragma: no cover
"""
Returns |(X - X2ᵀ)/lengthscales| (L2-norm).
"""
warnings.warn('scaled_euclid_dist is deprecated and will be removed '
'in GPflow version 1.4.0. For stationary kernels, '
'define K_r(r... | python | def scaled_euclid_dist(self, X, X2): # pragma: no cover
"""
Returns |(X - X2ᵀ)/lengthscales| (L2-norm).
"""
warnings.warn('scaled_euclid_dist is deprecated and will be removed '
'in GPflow version 1.4.0. For stationary kernels, '
'define K_r(r... | [
"def",
"scaled_euclid_dist",
"(",
"self",
",",
"X",
",",
"X2",
")",
":",
"# pragma: no cover",
"warnings",
".",
"warn",
"(",
"'scaled_euclid_dist is deprecated and will be removed '",
"'in GPflow version 1.4.0. For stationary kernels, '",
"'define K_r(r) instead.'",
",",
"Depre... | Returns |(X - X2ᵀ)/lengthscales| (L2-norm). | [
"Returns",
"|",
"(",
"X",
"-",
"X2ᵀ",
")",
"/",
"lengthscales|",
"(",
"L2",
"-",
"norm",
")",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L313-L322 | train | Returns the Euclidean distance between X and X2. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | Stationary.K | def K(self, X, X2=None, presliced=False):
"""
Calculates the kernel matrix K(X, X2) (or K(X, X) if X2 is None).
Handles the slicing as well as scaling and computes k(x, x') = k(r),
where r² = ((x - x')/lengthscales)².
Internally, this calls self.K_r2(r²), which in turn computes ... | python | def K(self, X, X2=None, presliced=False):
"""
Calculates the kernel matrix K(X, X2) (or K(X, X) if X2 is None).
Handles the slicing as well as scaling and computes k(x, x') = k(r),
where r² = ((x - x')/lengthscales)².
Internally, this calls self.K_r2(r²), which in turn computes ... | [
"def",
"K",
"(",
"self",
",",
"X",
",",
"X2",
"=",
"None",
",",
"presliced",
"=",
"False",
")",
":",
"if",
"not",
"presliced",
":",
"X",
",",
"X2",
"=",
"self",
".",
"_slice",
"(",
"X",
",",
"X2",
")",
"return",
"self",
".",
"K_r2",
"(",
"sel... | Calculates the kernel matrix K(X, X2) (or K(X, X) if X2 is None).
Handles the slicing as well as scaling and computes k(x, x') = k(r),
where r² = ((x - x')/lengthscales)².
Internally, this calls self.K_r2(r²), which in turn computes the
square-root and calls self.K_r(r). Classes impleme... | [
"Calculates",
"the",
"kernel",
"matrix",
"K",
"(",
"X",
"X2",
")",
"(",
"or",
"K",
"(",
"X",
"X",
")",
"if",
"X2",
"is",
"None",
")",
".",
"Handles",
"the",
"slicing",
"as",
"well",
"as",
"scaling",
"and",
"computes",
"k",
"(",
"x",
"x",
")",
"... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L330-L343 | train | Calculates the kernel matrix for a set of stationary kernels. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | Stationary.K_r2 | def K_r2(self, r2):
"""
Returns the kernel evaluated on `r2`, which is the scaled squared distance.
Will call self.K_r(r=sqrt(r2)), or can be overwritten directly (and should operate element-wise on r2).
"""
r = self._clipped_sqrt(r2)
return self.K_r(r) | python | def K_r2(self, r2):
"""
Returns the kernel evaluated on `r2`, which is the scaled squared distance.
Will call self.K_r(r=sqrt(r2)), or can be overwritten directly (and should operate element-wise on r2).
"""
r = self._clipped_sqrt(r2)
return self.K_r(r) | [
"def",
"K_r2",
"(",
"self",
",",
"r2",
")",
":",
"r",
"=",
"self",
".",
"_clipped_sqrt",
"(",
"r2",
")",
"return",
"self",
".",
"K_r",
"(",
"r",
")"
] | Returns the kernel evaluated on `r2`, which is the scaled squared distance.
Will call self.K_r(r=sqrt(r2)), or can be overwritten directly (and should operate element-wise on r2). | [
"Returns",
"the",
"kernel",
"evaluated",
"on",
"r2",
"which",
"is",
"the",
"scaled",
"squared",
"distance",
".",
"Will",
"call",
"self",
".",
"K_r",
"(",
"r",
"=",
"sqrt",
"(",
"r2",
"))",
"or",
"can",
"be",
"overwritten",
"directly",
"(",
"and",
"shou... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L353-L359 | train | Returns the kernel evaluated on r2 which is the scaled squared distance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | ArcCosine._J | def _J(self, theta):
"""
Implements the order dependent family of functions defined in equations
4 to 7 in the reference paper.
"""
if self.order == 0:
return np.pi - theta
elif self.order == 1:
return tf.sin(theta) + (np.pi - theta) * tf.cos(theta... | python | def _J(self, theta):
"""
Implements the order dependent family of functions defined in equations
4 to 7 in the reference paper.
"""
if self.order == 0:
return np.pi - theta
elif self.order == 1:
return tf.sin(theta) + (np.pi - theta) * tf.cos(theta... | [
"def",
"_J",
"(",
"self",
",",
"theta",
")",
":",
"if",
"self",
".",
"order",
"==",
"0",
":",
"return",
"np",
".",
"pi",
"-",
"theta",
"elif",
"self",
".",
"order",
"==",
"1",
":",
"return",
"tf",
".",
"sin",
"(",
"theta",
")",
"+",
"(",
"np"... | Implements the order dependent family of functions defined in equations
4 to 7 in the reference paper. | [
"Implements",
"the",
"order",
"dependent",
"family",
"of",
"functions",
"defined",
"in",
"equations",
"4",
"to",
"7",
"in",
"the",
"reference",
"paper",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L627-L638 | train | Returns the Jacobian of the object in the order dependent family of functions defined in equations
4 to 7 in the reference paper. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kernels.py | Combination.on_separate_dimensions | def on_separate_dimensions(self):
"""
Checks whether the kernels in the combination act on disjoint subsets
of dimensions. Currently, it is hard to asses whether two slice objects
will overlap, so this will always return False.
:return: Boolean indicator.
"""
if n... | python | def on_separate_dimensions(self):
"""
Checks whether the kernels in the combination act on disjoint subsets
of dimensions. Currently, it is hard to asses whether two slice objects
will overlap, so this will always return False.
:return: Boolean indicator.
"""
if n... | [
"def",
"on_separate_dimensions",
"(",
"self",
")",
":",
"if",
"np",
".",
"any",
"(",
"[",
"isinstance",
"(",
"k",
".",
"active_dims",
",",
"slice",
")",
"for",
"k",
"in",
"self",
".",
"kernels",
"]",
")",
":",
"# Be conservative in the case of a slice object... | Checks whether the kernels in the combination act on disjoint subsets
of dimensions. Currently, it is hard to asses whether two slice objects
will overlap, so this will always return False.
:return: Boolean indicator. | [
"Checks",
"whether",
"the",
"kernels",
"in",
"the",
"combination",
"act",
"on",
"disjoint",
"subsets",
"of",
"dimensions",
".",
"Currently",
"it",
"is",
"hard",
"to",
"asses",
"whether",
"two",
"slice",
"objects",
"will",
"overlap",
"so",
"this",
"will",
"al... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kernels.py#L810-L827 | train | Checks whether the kernels in the combination act on disjoint subsets
of dimensions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/transforms.py | Log1pe.backward | def backward(self, y):
r"""
Inverse of the softplus transform:
.. math::
x = \log( \exp(y) - 1)
The bound for the input y is [self._lower. inf[, self._lower is
subtracted prior to any calculations. The implementation avoids overflow
explicitly by applying the... | python | def backward(self, y):
r"""
Inverse of the softplus transform:
.. math::
x = \log( \exp(y) - 1)
The bound for the input y is [self._lower. inf[, self._lower is
subtracted prior to any calculations. The implementation avoids overflow
explicitly by applying the... | [
"def",
"backward",
"(",
"self",
",",
"y",
")",
":",
"ys",
"=",
"np",
".",
"maximum",
"(",
"y",
"-",
"self",
".",
"_lower",
",",
"np",
".",
"finfo",
"(",
"settings",
".",
"float_type",
")",
".",
"eps",
")",
"return",
"ys",
"+",
"np",
".",
"log",... | r"""
Inverse of the softplus transform:
.. math::
x = \log( \exp(y) - 1)
The bound for the input y is [self._lower. inf[, self._lower is
subtracted prior to any calculations. The implementation avoids overflow
explicitly by applying the log sum exp trick:
.. ... | [
"r",
"Inverse",
"of",
"the",
"softplus",
"transform",
":",
"..",
"math",
"::"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/transforms.py#L162-L189 | train | r Backwards transform the internal state of the current object to the internal state of the new object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/transforms.py | LowerTriangular.forward | def forward(self, x):
"""
Transforms from the packed to unpacked representations (numpy)
:param x: packed numpy array. Must have shape `self.num_matrices x triangular_number
:return: Reconstructed numpy array y of shape self.num_matrices x N x N
"""
fwd = np.zero... | python | def forward(self, x):
"""
Transforms from the packed to unpacked representations (numpy)
:param x: packed numpy array. Must have shape `self.num_matrices x triangular_number
:return: Reconstructed numpy array y of shape self.num_matrices x N x N
"""
fwd = np.zero... | [
"def",
"forward",
"(",
"self",
",",
"x",
")",
":",
"fwd",
"=",
"np",
".",
"zeros",
"(",
"(",
"self",
".",
"num_matrices",
",",
"self",
".",
"N",
",",
"self",
".",
"N",
")",
",",
"settings",
".",
"float_type",
")",
"indices",
"=",
"np",
".",
"tr... | Transforms from the packed to unpacked representations (numpy)
:param x: packed numpy array. Must have shape `self.num_matrices x triangular_number
:return: Reconstructed numpy array y of shape self.num_matrices x N x N | [
"Transforms",
"from",
"the",
"packed",
"to",
"unpacked",
"representations",
"(",
"numpy",
")",
":",
"param",
"x",
":",
"packed",
"numpy",
"array",
".",
"Must",
"have",
"shape",
"self",
".",
"num_matrices",
"x",
"triangular_number",
":",
"return",
":",
"Recon... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/transforms.py#L342-L354 | train | Transforms from the packed to unpacked representations ( numpy ) N
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/transforms.py | LowerTriangular.backward | def backward(self, y):
"""
Transforms a series of triangular matrices y to the packed representation x (numpy)
:param y: unpacked numpy array y, shape self.num_matrices x N x N
:return: packed numpy array, x, shape self.num_matrices x triangular number
"""
if sel... | python | def backward(self, y):
"""
Transforms a series of triangular matrices y to the packed representation x (numpy)
:param y: unpacked numpy array y, shape self.num_matrices x N x N
:return: packed numpy array, x, shape self.num_matrices x triangular number
"""
if sel... | [
"def",
"backward",
"(",
"self",
",",
"y",
")",
":",
"if",
"self",
".",
"squeeze",
":",
"y",
"=",
"y",
"[",
"None",
",",
":",
",",
":",
"]",
"ind",
"=",
"np",
".",
"tril_indices",
"(",
"self",
".",
"N",
")",
"return",
"np",
".",
"vstack",
"(",... | Transforms a series of triangular matrices y to the packed representation x (numpy)
:param y: unpacked numpy array y, shape self.num_matrices x N x N
:return: packed numpy array, x, shape self.num_matrices x triangular number | [
"Transforms",
"a",
"series",
"of",
"triangular",
"matrices",
"y",
"to",
"the",
"packed",
"representation",
"x",
"(",
"numpy",
")",
":",
"param",
"y",
":",
"unpacked",
"numpy",
"array",
"y",
"shape",
"self",
".",
"num_matrices",
"x",
"N",
"x",
"N",
":",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/transforms.py#L356-L366 | train | Transforms a series of triangular matrices y to the packed representation x | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/transforms.py | LowerTriangular.forward_tensor | def forward_tensor(self, x):
"""
Transforms from the packed to unpacked representations (tf.tensors)
:param x: packed tensor. Must have shape `self.num_matrices x triangular_number
:return: Reconstructed tensor y of shape self.num_matrices x N x N
"""
fwd = vec_t... | python | def forward_tensor(self, x):
"""
Transforms from the packed to unpacked representations (tf.tensors)
:param x: packed tensor. Must have shape `self.num_matrices x triangular_number
:return: Reconstructed tensor y of shape self.num_matrices x N x N
"""
fwd = vec_t... | [
"def",
"forward_tensor",
"(",
"self",
",",
"x",
")",
":",
"fwd",
"=",
"vec_to_tri",
"(",
"x",
",",
"self",
".",
"N",
")",
"return",
"tf",
".",
"squeeze",
"(",
"fwd",
",",
"axis",
"=",
"0",
")",
"if",
"self",
".",
"squeeze",
"else",
"fwd"
] | Transforms from the packed to unpacked representations (tf.tensors)
:param x: packed tensor. Must have shape `self.num_matrices x triangular_number
:return: Reconstructed tensor y of shape self.num_matrices x N x N | [
"Transforms",
"from",
"the",
"packed",
"to",
"unpacked",
"representations",
"(",
"tf",
".",
"tensors",
")",
":",
"param",
"x",
":",
"packed",
"tensor",
".",
"Must",
"have",
"shape",
"self",
".",
"num_matrices",
"x",
"triangular_number",
":",
"return",
":",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/transforms.py#L368-L376 | train | Transforms from the packed representation of N x N to unpacked representations of N x N | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/transforms.py | LowerTriangular.backward_tensor | def backward_tensor(self, y):
"""
Transforms a series of triangular matrices y to the packed representation x (tf.tensors)
:param y: unpacked tensor with shape self.num_matrices, self.N, self.N
:return: packed tensor with shape self.num_matrices, (self.N**2 + self.N) / 2
... | python | def backward_tensor(self, y):
"""
Transforms a series of triangular matrices y to the packed representation x (tf.tensors)
:param y: unpacked tensor with shape self.num_matrices, self.N, self.N
:return: packed tensor with shape self.num_matrices, (self.N**2 + self.N) / 2
... | [
"def",
"backward_tensor",
"(",
"self",
",",
"y",
")",
":",
"if",
"self",
".",
"squeeze",
":",
"y",
"=",
"tf",
".",
"expand_dims",
"(",
"y",
",",
"axis",
"=",
"0",
")",
"indices",
"=",
"np",
".",
"vstack",
"(",
"np",
".",
"tril_indices",
"(",
"sel... | Transforms a series of triangular matrices y to the packed representation x (tf.tensors)
:param y: unpacked tensor with shape self.num_matrices, self.N, self.N
:return: packed tensor with shape self.num_matrices, (self.N**2 + self.N) / 2 | [
"Transforms",
"a",
"series",
"of",
"triangular",
"matrices",
"y",
"to",
"the",
"packed",
"representation",
"x",
"(",
"tf",
".",
"tensors",
")",
":",
"param",
"y",
":",
"unpacked",
"tensor",
"with",
"shape",
"self",
".",
"num_matrices",
"self",
".",
"N",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/transforms.py#L378-L391 | train | Transforms a series of triangular matrices y to the packed representation x. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/autoflow.py | AutoFlow.get_autoflow | def get_autoflow(cls, obj, name):
"""
Extracts from an object existing dictionary with tensors specified by name.
If there is no such object then new one will be created. Intenally, it appends
autoflow prefix to the name and saves it as an attribute.
:param obj: target GPflow ob... | python | def get_autoflow(cls, obj, name):
"""
Extracts from an object existing dictionary with tensors specified by name.
If there is no such object then new one will be created. Intenally, it appends
autoflow prefix to the name and saves it as an attribute.
:param obj: target GPflow ob... | [
"def",
"get_autoflow",
"(",
"cls",
",",
"obj",
",",
"name",
")",
":",
"if",
"not",
"isinstance",
"(",
"name",
",",
"str",
")",
":",
"raise",
"ValueError",
"(",
"'Name must be string.'",
")",
"prefix",
"=",
"cls",
".",
"__autoflow_prefix__",
"autoflow_name",
... | Extracts from an object existing dictionary with tensors specified by name.
If there is no such object then new one will be created. Intenally, it appends
autoflow prefix to the name and saves it as an attribute.
:param obj: target GPflow object.
:param name: unique part of autoflow att... | [
"Extracts",
"from",
"an",
"object",
"existing",
"dictionary",
"with",
"tensors",
"specified",
"by",
"name",
".",
"If",
"there",
"is",
"no",
"such",
"object",
"then",
"new",
"one",
"will",
"be",
"created",
".",
"Intenally",
"it",
"appends",
"autoflow",
"prefi... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/autoflow.py#L28-L46 | train | Extracts a dictionary with tensors specified by name from an object existing dictionary with tensors specified by name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/core/autoflow.py | AutoFlow.clear_autoflow | def clear_autoflow(cls, obj, name=None):
"""
Clear autoflow's tensor storage.
:param obj: target GPflow object.
:param name: accepts either string value which is unique part of
an internal attribute name or None value. When None value is passed all
storages will ... | python | def clear_autoflow(cls, obj, name=None):
"""
Clear autoflow's tensor storage.
:param obj: target GPflow object.
:param name: accepts either string value which is unique part of
an internal attribute name or None value. When None value is passed all
storages will ... | [
"def",
"clear_autoflow",
"(",
"cls",
",",
"obj",
",",
"name",
"=",
"None",
")",
":",
"if",
"name",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"name",
",",
"str",
")",
":",
"raise",
"ValueError",
"(",
"'Name must be a string.'",
")",
"prefix",
... | Clear autoflow's tensor storage.
:param obj: target GPflow object.
:param name: accepts either string value which is unique part of
an internal attribute name or None value. When None value is passed all
storages will be cleared, in other words it clears everything with common
... | [
"Clear",
"autoflow",
"s",
"tensor",
"storage",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/core/autoflow.py#L49-L70 | train | Clears autoflow s tensor storage. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/vgp.py | VGP.compile | def compile(self, session=None):
"""
Before calling the standard compile function, check to see if the size
of the data has changed and add variational parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data.
"""
... | python | def compile(self, session=None):
"""
Before calling the standard compile function, check to see if the size
of the data has changed and add variational parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data.
"""
... | [
"def",
"compile",
"(",
"self",
",",
"session",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"num_data",
"==",
"self",
".",
"X",
".",
"shape",
"[",
"0",
"]",
":",
"self",
".",
"num_data",
"=",
"self",
".",
"X",
".",
"shape",
"[",
"0",
"]",
... | Before calling the standard compile function, check to see if the size
of the data has changed and add variational parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data. | [
"Before",
"calling",
"the",
"standard",
"compile",
"function",
"check",
"to",
"see",
"if",
"the",
"size",
"of",
"the",
"data",
"has",
"changed",
"and",
"add",
"variational",
"parameters",
"appropriately",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/vgp.py#L72-L86 | train | Compile the VGP into a single parameter vector. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/vgp.py | VGP._build_likelihood | def _build_likelihood(self):
r"""
This method computes the variational lower bound on the likelihood,
which is:
E_{q(F)} [ \log p(Y|F) ] - KL[ q(F) || p(F)]
with
q(\mathbf f) = N(\mathbf f \,|\, \boldsymbol \mu, \boldsymbol \Sigma)
"""
# Get p... | python | def _build_likelihood(self):
r"""
This method computes the variational lower bound on the likelihood,
which is:
E_{q(F)} [ \log p(Y|F) ] - KL[ q(F) || p(F)]
with
q(\mathbf f) = N(\mathbf f \,|\, \boldsymbol \mu, \boldsymbol \Sigma)
"""
# Get p... | [
"def",
"_build_likelihood",
"(",
"self",
")",
":",
"# Get prior KL.",
"KL",
"=",
"gauss_kl",
"(",
"self",
".",
"q_mu",
",",
"self",
".",
"q_sqrt",
")",
"# Get conditionals",
"K",
"=",
"self",
".",
"kern",
".",
"K",
"(",
"self",
".",
"X",
")",
"+",
"t... | r"""
This method computes the variational lower bound on the likelihood,
which is:
E_{q(F)} [ \log p(Y|F) ] - KL[ q(F) || p(F)]
with
q(\mathbf f) = N(\mathbf f \,|\, \boldsymbol \mu, \boldsymbol \Sigma) | [
"r",
"This",
"method",
"computes",
"the",
"variational",
"lower",
"bound",
"on",
"the",
"likelihood",
"which",
"is",
":"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/vgp.py#L89-L124 | train | r This method builds the likelihood matrix for the current object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/vgp.py | VGP_opper_archambeau.compile | def compile(self, session=None):
"""
Before calling the standard compile function, check to see if the size
of the data has changed and add variational parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data.
"""
... | python | def compile(self, session=None):
"""
Before calling the standard compile function, check to see if the size
of the data has changed and add variational parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data.
"""
... | [
"def",
"compile",
"(",
"self",
",",
"session",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"num_data",
"==",
"self",
".",
"X",
".",
"shape",
"[",
"0",
"]",
":",
"self",
".",
"num_data",
"=",
"self",
".",
"X",
".",
"shape",
"[",
"0",
"]",
... | Before calling the standard compile function, check to see if the size
of the data has changed and add variational parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data. | [
"Before",
"calling",
"the",
"standard",
"compile",
"function",
"check",
"to",
"see",
"if",
"the",
"size",
"of",
"the",
"data",
"has",
"changed",
"and",
"add",
"variational",
"parameters",
"appropriately",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/vgp.py#L181-L194 | train | Compile the VGP_opper_archambeau object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/vgp.py | VGP_opper_archambeau._build_likelihood | def _build_likelihood(self):
r"""
q_alpha, q_lambda are variational parameters, size N x R
This method computes the variational lower bound on the likelihood,
which is:
E_{q(F)} [ \log p(Y|F) ] - KL[ q(F) || p(F)]
with
q(f) = N(f | K alpha + mean, [K^-1 + ... | python | def _build_likelihood(self):
r"""
q_alpha, q_lambda are variational parameters, size N x R
This method computes the variational lower bound on the likelihood,
which is:
E_{q(F)} [ \log p(Y|F) ] - KL[ q(F) || p(F)]
with
q(f) = N(f | K alpha + mean, [K^-1 + ... | [
"def",
"_build_likelihood",
"(",
"self",
")",
":",
"K",
"=",
"self",
".",
"kern",
".",
"K",
"(",
"self",
".",
"X",
")",
"K_alpha",
"=",
"tf",
".",
"matmul",
"(",
"K",
",",
"self",
".",
"q_alpha",
")",
"f_mean",
"=",
"K_alpha",
"+",
"self",
".",
... | r"""
q_alpha, q_lambda are variational parameters, size N x R
This method computes the variational lower bound on the likelihood,
which is:
E_{q(F)} [ \log p(Y|F) ] - KL[ q(F) || p(F)]
with
q(f) = N(f | K alpha + mean, [K^-1 + diag(square(lambda))]^-1) . | [
"r",
"q_alpha",
"q_lambda",
"are",
"variational",
"parameters",
"size",
"N",
"x",
"R",
"This",
"method",
"computes",
"the",
"variational",
"lower",
"bound",
"on",
"the",
"likelihood",
"which",
"is",
":",
"E_",
"{",
"q",
"(",
"F",
")",
"}",
"[",
"\\",
"... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/vgp.py#L197-L228 | train | r Builds the likelihood matrix for the current log likelihood and the likelihood of the current log likelihood. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/vgp.py | VGP_opper_archambeau._build_predict | def _build_predict(self, Xnew, full_cov=False):
"""
The posterior variance of F is given by
q(f) = N(f | K alpha + mean, [K^-1 + diag(lambda**2)]^-1)
Here we project this to F*, the values of the GP at Xnew which is given
by
q(F*) = N ( F* | K_{*F} alpha + mean, K_... | python | def _build_predict(self, Xnew, full_cov=False):
"""
The posterior variance of F is given by
q(f) = N(f | K alpha + mean, [K^-1 + diag(lambda**2)]^-1)
Here we project this to F*, the values of the GP at Xnew which is given
by
q(F*) = N ( F* | K_{*F} alpha + mean, K_... | [
"def",
"_build_predict",
"(",
"self",
",",
"Xnew",
",",
"full_cov",
"=",
"False",
")",
":",
"# compute kernel things",
"Kx",
"=",
"self",
".",
"kern",
".",
"K",
"(",
"self",
".",
"X",
",",
"Xnew",
")",
"K",
"=",
"self",
".",
"kern",
".",
"K",
"(",
... | The posterior variance of F is given by
q(f) = N(f | K alpha + mean, [K^-1 + diag(lambda**2)]^-1)
Here we project this to F*, the values of the GP at Xnew which is given
by
q(F*) = N ( F* | K_{*F} alpha + mean, K_{**} - K_{*f}[K_{ff} +
di... | [
"The",
"posterior",
"variance",
"of",
"F",
"is",
"given",
"by",
"q",
"(",
"f",
")",
"=",
"N",
"(",
"f",
"|",
"K",
"alpha",
"+",
"mean",
"[",
"K^",
"-",
"1",
"+",
"diag",
"(",
"lambda",
"**",
"2",
")",
"]",
"^",
"-",
"1",
")",
"Here",
"we",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/vgp.py#L231-L257 | train | Build predict and variance of the new object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/sgpmc.py | SGPMC._build_likelihood | def _build_likelihood(self):
"""
This function computes the optimal density for v, q*(v), up to a constant
"""
# get the (marginals of) q(f): exactly predicting!
fmean, fvar = self._build_predict(self.X, full_cov=False)
return tf.reduce_sum(self.likelihood.variational_exp... | python | def _build_likelihood(self):
"""
This function computes the optimal density for v, q*(v), up to a constant
"""
# get the (marginals of) q(f): exactly predicting!
fmean, fvar = self._build_predict(self.X, full_cov=False)
return tf.reduce_sum(self.likelihood.variational_exp... | [
"def",
"_build_likelihood",
"(",
"self",
")",
":",
"# get the (marginals of) q(f): exactly predicting!",
"fmean",
",",
"fvar",
"=",
"self",
".",
"_build_predict",
"(",
"self",
".",
"X",
",",
"full_cov",
"=",
"False",
")",
"return",
"tf",
".",
"reduce_sum",
"(",
... | This function computes the optimal density for v, q*(v), up to a constant | [
"This",
"function",
"computes",
"the",
"optimal",
"density",
"for",
"v",
"q",
"*",
"(",
"v",
")",
"up",
"to",
"a",
"constant"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/sgpmc.py#L80-L86 | train | This function computes the optimal density for v up to a constant
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/_settings.py | _parse | def _parse(string):
"""
Very simple config values parser.
"""
if not isinstance(string, str):
raise ValueError('Config value "{0}" expected to be string.'
.format(string))
if string in ['true', 'True']:
return True
elif string in ['false', 'False']:
... | python | def _parse(string):
"""
Very simple config values parser.
"""
if not isinstance(string, str):
raise ValueError('Config value "{0}" expected to be string.'
.format(string))
if string in ['true', 'True']:
return True
elif string in ['false', 'False']:
... | [
"def",
"_parse",
"(",
"string",
")",
":",
"if",
"not",
"isinstance",
"(",
"string",
",",
"str",
")",
":",
"raise",
"ValueError",
"(",
"'Config value \"{0}\" expected to be string.'",
".",
"format",
"(",
"string",
")",
")",
"if",
"string",
"in",
"[",
"'true'"... | Very simple config values parser. | [
"Very",
"simple",
"config",
"values",
"parser",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/_settings.py#L105-L127 | train | Parses a string into a base64 - encoded version of the attribute. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/_settings.py | _namedtuplify | def _namedtuplify(mapping):
"""
Make the dictionary into a nested series of named tuples.
This is what allows accessing by attribute: settings.numerics.jitter
Thank you https://gist.github.com/hangtwenty/5960435
"""
if isinstance(mapping, collections.Mapping):
for key, value in list(mapp... | python | def _namedtuplify(mapping):
"""
Make the dictionary into a nested series of named tuples.
This is what allows accessing by attribute: settings.numerics.jitter
Thank you https://gist.github.com/hangtwenty/5960435
"""
if isinstance(mapping, collections.Mapping):
for key, value in list(mapp... | [
"def",
"_namedtuplify",
"(",
"mapping",
")",
":",
"if",
"isinstance",
"(",
"mapping",
",",
"collections",
".",
"Mapping",
")",
":",
"for",
"key",
",",
"value",
"in",
"list",
"(",
"mapping",
".",
"items",
"(",
")",
")",
":",
"mapping",
"[",
"key",
"]"... | Make the dictionary into a nested series of named tuples.
This is what allows accessing by attribute: settings.numerics.jitter
Thank you https://gist.github.com/hangtwenty/5960435 | [
"Make",
"the",
"dictionary",
"into",
"a",
"nested",
"series",
"of",
"named",
"tuples",
".",
"This",
"is",
"what",
"allows",
"accessing",
"by",
"attribute",
":",
"settings",
".",
"numerics",
".",
"jitter",
"Thank",
"you",
"https",
":",
"//",
"gist",
".",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/_settings.py#L130-L145 | train | Takes a dictionary and returns a nested tuple of named tuples. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/_settings.py | _read_config_file | def _read_config_file(path=None):
"""
Reads config file.
First look for config file in the current directory, then in the
user's home directory, then in the same directory as this file.
Tries to find config file both with and without preceeding 'dot'
for hidden files (prefer non-hidden).
"""... | python | def _read_config_file(path=None):
"""
Reads config file.
First look for config file in the current directory, then in the
user's home directory, then in the same directory as this file.
Tries to find config file both with and without preceeding 'dot'
for hidden files (prefer non-hidden).
"""... | [
"def",
"_read_config_file",
"(",
"path",
"=",
"None",
")",
":",
"cfg",
"=",
"configparser",
".",
"ConfigParser",
"(",
")",
"if",
"path",
"is",
"None",
":",
"# pragma: no cover",
"dirs",
"=",
"[",
"os",
".",
"curdir",
",",
"os",
".",
"path",
".",
"expan... | Reads config file.
First look for config file in the current directory, then in the
user's home directory, then in the same directory as this file.
Tries to find config file both with and without preceeding 'dot'
for hidden files (prefer non-hidden). | [
"Reads",
"config",
"file",
".",
"First",
"look",
"for",
"config",
"file",
"in",
"the",
"current",
"directory",
"then",
"in",
"the",
"user",
"s",
"home",
"directory",
"then",
"in",
"the",
"same",
"directory",
"as",
"this",
"file",
".",
"Tries",
"to",
"fin... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/_settings.py#L148-L170 | train | Reads config file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/quadrature.py | mvhermgauss | def mvhermgauss(H: int, D: int):
"""
Return the evaluation locations 'xn', and weights 'wn' for a multivariate
Gauss-Hermite quadrature.
The outputs can be used to approximate the following type of integral:
int exp(-x)*f(x) dx ~ sum_i w[i,:]*f(x[i,:])
:param H: Number of Gauss-Hermite evaluat... | python | def mvhermgauss(H: int, D: int):
"""
Return the evaluation locations 'xn', and weights 'wn' for a multivariate
Gauss-Hermite quadrature.
The outputs can be used to approximate the following type of integral:
int exp(-x)*f(x) dx ~ sum_i w[i,:]*f(x[i,:])
:param H: Number of Gauss-Hermite evaluat... | [
"def",
"mvhermgauss",
"(",
"H",
":",
"int",
",",
"D",
":",
"int",
")",
":",
"gh_x",
",",
"gh_w",
"=",
"hermgauss",
"(",
"H",
")",
"x",
"=",
"np",
".",
"array",
"(",
"list",
"(",
"itertools",
".",
"product",
"(",
"*",
"(",
"gh_x",
",",
")",
"*... | Return the evaluation locations 'xn', and weights 'wn' for a multivariate
Gauss-Hermite quadrature.
The outputs can be used to approximate the following type of integral:
int exp(-x)*f(x) dx ~ sum_i w[i,:]*f(x[i,:])
:param H: Number of Gauss-Hermite evaluation points.
:param D: Number of input dim... | [
"Return",
"the",
"evaluation",
"locations",
"xn",
"and",
"weights",
"wn",
"for",
"a",
"multivariate",
"Gauss",
"-",
"Hermite",
"quadrature",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/quadrature.py#L31-L46 | train | Returns the evaluation locations x and weights wn for a multivariate
Gauss - Hermite quadrature. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/quadrature.py | mvnquad | def mvnquad(func, means, covs, H: int, Din: int=None, Dout=None):
"""
Computes N Gaussian expectation integrals of a single function 'f'
using Gauss-Hermite quadrature.
:param f: integrand function. Takes one input of shape ?xD.
:param means: NxD
:param covs: NxDxD
:param H: Number of Gauss-... | python | def mvnquad(func, means, covs, H: int, Din: int=None, Dout=None):
"""
Computes N Gaussian expectation integrals of a single function 'f'
using Gauss-Hermite quadrature.
:param f: integrand function. Takes one input of shape ?xD.
:param means: NxD
:param covs: NxDxD
:param H: Number of Gauss-... | [
"def",
"mvnquad",
"(",
"func",
",",
"means",
",",
"covs",
",",
"H",
":",
"int",
",",
"Din",
":",
"int",
"=",
"None",
",",
"Dout",
"=",
"None",
")",
":",
"# Figure out input shape information",
"if",
"Din",
"is",
"None",
":",
"Din",
"=",
"means",
".",... | Computes N Gaussian expectation integrals of a single function 'f'
using Gauss-Hermite quadrature.
:param f: integrand function. Takes one input of shape ?xD.
:param means: NxD
:param covs: NxDxD
:param H: Number of Gauss-Hermite evaluation points.
:param Din: Number of input dimensions. Needs t... | [
"Computes",
"N",
"Gaussian",
"expectation",
"integrals",
"of",
"a",
"single",
"function",
"f",
"using",
"Gauss",
"-",
"Hermite",
"quadrature",
".",
":",
"param",
"f",
":",
"integrand",
"function",
".",
"Takes",
"one",
"input",
"of",
"shape",
"?xD",
".",
":... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/quadrature.py#L49-L92 | train | Compute N Gaussian expectation integrals of a single function f. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/quadrature.py | ndiagquad | def ndiagquad(funcs, H: int, Fmu, Fvar, logspace: bool=False, **Ys):
"""
Computes N Gaussian expectation integrals of one or more functions
using Gauss-Hermite quadrature. The Gaussians must be independent.
:param funcs: the integrand(s):
Callable or Iterable of Callables that operates elementw... | python | def ndiagquad(funcs, H: int, Fmu, Fvar, logspace: bool=False, **Ys):
"""
Computes N Gaussian expectation integrals of one or more functions
using Gauss-Hermite quadrature. The Gaussians must be independent.
:param funcs: the integrand(s):
Callable or Iterable of Callables that operates elementw... | [
"def",
"ndiagquad",
"(",
"funcs",
",",
"H",
":",
"int",
",",
"Fmu",
",",
"Fvar",
",",
"logspace",
":",
"bool",
"=",
"False",
",",
"*",
"*",
"Ys",
")",
":",
"def",
"unify",
"(",
"f_list",
")",
":",
"\"\"\"\n Stack a list of means/vars into a full blo... | Computes N Gaussian expectation integrals of one or more functions
using Gauss-Hermite quadrature. The Gaussians must be independent.
:param funcs: the integrand(s):
Callable or Iterable of Callables that operates elementwise, on the following arguments:
- `Din` positional arguments to match Fm... | [
"Computes",
"N",
"Gaussian",
"expectation",
"integrals",
"of",
"one",
"or",
"more",
"functions",
"using",
"Gauss",
"-",
"Hermite",
"quadrature",
".",
"The",
"Gaussians",
"must",
"be",
"independent",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/quadrature.py#L95-L198 | train | This function calculates the N Gaussian expectation integrals of one or more functions and returns the shape of the resulting array. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/quadrature.py | ndiag_mc | def ndiag_mc(funcs, S: int, Fmu, Fvar, logspace: bool=False, epsilon=None, **Ys):
"""
Computes N Gaussian expectation integrals of one or more functions
using Monte Carlo samples. The Gaussians must be independent.
:param funcs: the integrand(s):
Callable or Iterable of Callables that operates ... | python | def ndiag_mc(funcs, S: int, Fmu, Fvar, logspace: bool=False, epsilon=None, **Ys):
"""
Computes N Gaussian expectation integrals of one or more functions
using Monte Carlo samples. The Gaussians must be independent.
:param funcs: the integrand(s):
Callable or Iterable of Callables that operates ... | [
"def",
"ndiag_mc",
"(",
"funcs",
",",
"S",
":",
"int",
",",
"Fmu",
",",
"Fvar",
",",
"logspace",
":",
"bool",
"=",
"False",
",",
"epsilon",
"=",
"None",
",",
"*",
"*",
"Ys",
")",
":",
"N",
",",
"D",
"=",
"tf",
".",
"shape",
"(",
"Fmu",
")",
... | Computes N Gaussian expectation integrals of one or more functions
using Monte Carlo samples. The Gaussians must be independent.
:param funcs: the integrand(s):
Callable or Iterable of Callables that operates elementwise
:param S: number of Monte Carlo sampling points
:param Fmu: array/tensor
... | [
"Computes",
"N",
"Gaussian",
"expectation",
"integrals",
"of",
"one",
"or",
"more",
"functions",
"using",
"Monte",
"Carlo",
"samples",
".",
"The",
"Gaussians",
"must",
"be",
"independent",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/quadrature.py#L201-L244 | train | Computes N Gaussian expectation integrals of one or more functions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/decors.py | name_scope | def name_scope(name=None):
"""
This decorator wraps a function so that it runs inside a TensorFlow
name scope. The name is given by the `name` option; if this is None,
then the name of the function will be used.
```
>>> @name_scope()
>>> def foo(...):
>>> # now runs inside scope "foo... | python | def name_scope(name=None):
"""
This decorator wraps a function so that it runs inside a TensorFlow
name scope. The name is given by the `name` option; if this is None,
then the name of the function will be used.
```
>>> @name_scope()
>>> def foo(...):
>>> # now runs inside scope "foo... | [
"def",
"name_scope",
"(",
"name",
"=",
"None",
")",
":",
"def",
"name_scope_wrapper_decorator",
"(",
"method",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"method",
")",
"def",
"name_scope_wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",... | This decorator wraps a function so that it runs inside a TensorFlow
name scope. The name is given by the `name` option; if this is None,
then the name of the function will be used.
```
>>> @name_scope()
>>> def foo(...):
>>> # now runs inside scope "foo"
>>> @name_scope('bar')
>>> de... | [
"This",
"decorator",
"wraps",
"a",
"function",
"so",
"that",
"it",
"runs",
"inside",
"a",
"TensorFlow",
"name",
"scope",
".",
"The",
"name",
"is",
"given",
"by",
"the",
"name",
"option",
";",
"if",
"this",
"is",
"None",
"then",
"the",
"name",
"of",
"th... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/decors.py#L30-L51 | train | A decorator that creates a TensorFlow name scope. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/decors.py | params_as_tensors | def params_as_tensors(method):
"""
The `params_as_tensors` decorator converts representation for parameters into
their unconstrained tensors, and data holders to their data tensors inside
wrapped function, subject to this function is a member of parameterized object.
"""
@functools.wraps(method)... | python | def params_as_tensors(method):
"""
The `params_as_tensors` decorator converts representation for parameters into
their unconstrained tensors, and data holders to their data tensors inside
wrapped function, subject to this function is a member of parameterized object.
"""
@functools.wraps(method)... | [
"def",
"params_as_tensors",
"(",
"method",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"method",
")",
"def",
"tensor_mode_wrapper",
"(",
"obj",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"obj",
",",
"Paramet... | The `params_as_tensors` decorator converts representation for parameters into
their unconstrained tensors, and data holders to their data tensors inside
wrapped function, subject to this function is a member of parameterized object. | [
"The",
"params_as_tensors",
"decorator",
"converts",
"representation",
"for",
"parameters",
"into",
"their",
"unconstrained",
"tensors",
"and",
"data",
"holders",
"to",
"their",
"data",
"tensors",
"inside",
"wrapped",
"function",
"subject",
"to",
"this",
"function",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/decors.py#L54-L71 | train | A function decorator that converts representation for parameters into
their unconstrained tensors and data holders to their data holders. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/decors.py | params_as_tensors_for | def params_as_tensors_for(*objs, convert=True):
"""
Context manager which changes the representation of parameters and data holders
for the specific parameterized object(s).
This can also be used to turn off tensor conversion functions wrapped with
`params_as_tensors`:
```
@gpflow.params_as... | python | def params_as_tensors_for(*objs, convert=True):
"""
Context manager which changes the representation of parameters and data holders
for the specific parameterized object(s).
This can also be used to turn off tensor conversion functions wrapped with
`params_as_tensors`:
```
@gpflow.params_as... | [
"def",
"params_as_tensors_for",
"(",
"*",
"objs",
",",
"convert",
"=",
"True",
")",
":",
"objs",
"=",
"set",
"(",
"objs",
")",
"# remove duplicate objects so the tensor mode won't be changed before saving",
"prev_values",
"=",
"[",
"_params_as_tensors_enter",
"(",
"o",
... | Context manager which changes the representation of parameters and data holders
for the specific parameterized object(s).
This can also be used to turn off tensor conversion functions wrapped with
`params_as_tensors`:
```
@gpflow.params_as_tensors
def compute_something(self): # self is paramet... | [
"Context",
"manager",
"which",
"changes",
"the",
"representation",
"of",
"parameters",
"and",
"data",
"holders",
"for",
"the",
"specific",
"parameterized",
"object",
"(",
"s",
")",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/decors.py#L118-L144 | train | Context manager which converts parameters and data holders for a list of parameterized objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/kullback_leiblers.py | gauss_kl | def gauss_kl(q_mu, q_sqrt, K=None, *, K_cholesky=None):
"""
Compute the KL divergence KL[q || p] between
q(x) = N(q_mu, q_sqrt^2)
and
p(x) = N(0, K)
We assume N multiple independent distributions, given by the columns of
q_mu and the last dimension of q_sqrt. Returns the sum of... | python | def gauss_kl(q_mu, q_sqrt, K=None, *, K_cholesky=None):
"""
Compute the KL divergence KL[q || p] between
q(x) = N(q_mu, q_sqrt^2)
and
p(x) = N(0, K)
We assume N multiple independent distributions, given by the columns of
q_mu and the last dimension of q_sqrt. Returns the sum of... | [
"def",
"gauss_kl",
"(",
"q_mu",
",",
"q_sqrt",
",",
"K",
"=",
"None",
",",
"*",
",",
"K_cholesky",
"=",
"None",
")",
":",
"if",
"(",
"K",
"is",
"not",
"None",
")",
"and",
"(",
"K_cholesky",
"is",
"not",
"None",
")",
":",
"raise",
"ValueError",
"(... | Compute the KL divergence KL[q || p] between
q(x) = N(q_mu, q_sqrt^2)
and
p(x) = N(0, K)
We assume N multiple independent distributions, given by the columns of
q_mu and the last dimension of q_sqrt. Returns the sum of the divergences.
q_mu is a matrix [M, L], each column contains... | [
"Compute",
"the",
"KL",
"divergence",
"KL",
"[",
"q",
"||",
"p",
"]",
"between"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/kullback_leiblers.py#L25-L116 | train | Compute the KL divergence for a single set of independent distributions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/gplvm.py | PCA_reduce | def PCA_reduce(X, Q):
"""
A helpful function for linearly reducing the dimensionality of the data X
to Q.
:param X: data array of size N (number of points) x D (dimensions)
:param Q: Number of latent dimensions, Q < D
:return: PCA projection array of size N x Q.
"""
assert Q <= X.shape[1... | python | def PCA_reduce(X, Q):
"""
A helpful function for linearly reducing the dimensionality of the data X
to Q.
:param X: data array of size N (number of points) x D (dimensions)
:param Q: Number of latent dimensions, Q < D
:return: PCA projection array of size N x Q.
"""
assert Q <= X.shape[1... | [
"def",
"PCA_reduce",
"(",
"X",
",",
"Q",
")",
":",
"assert",
"Q",
"<=",
"X",
".",
"shape",
"[",
"1",
"]",
",",
"'Cannot have more latent dimensions than observed'",
"evals",
",",
"evecs",
"=",
"np",
".",
"linalg",
".",
"eigh",
"(",
"np",
".",
"cov",
"(... | A helpful function for linearly reducing the dimensionality of the data X
to Q.
:param X: data array of size N (number of points) x D (dimensions)
:param Q: Number of latent dimensions, Q < D
:return: PCA projection array of size N x Q. | [
"A",
"helpful",
"function",
"for",
"linearly",
"reducing",
"the",
"dimensionality",
"of",
"the",
"data",
"X",
"to",
"Q",
".",
":",
"param",
"X",
":",
"data",
"array",
"of",
"size",
"N",
"(",
"number",
"of",
"points",
")",
"x",
"D",
"(",
"dimensions",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/gplvm.py#L209-L220 | train | A helpful function for linearly reducing the dimensionality of the data X to Q | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/gplvm.py | BayesianGPLVM._build_likelihood | def _build_likelihood(self):
"""
Construct a tensorflow function to compute the bound on the marginal
likelihood.
"""
pX = DiagonalGaussian(self.X_mean, self.X_var)
num_inducing = len(self.feature)
psi0 = tf.reduce_sum(expectation(pX, self.kern))
psi1 = e... | python | def _build_likelihood(self):
"""
Construct a tensorflow function to compute the bound on the marginal
likelihood.
"""
pX = DiagonalGaussian(self.X_mean, self.X_var)
num_inducing = len(self.feature)
psi0 = tf.reduce_sum(expectation(pX, self.kern))
psi1 = e... | [
"def",
"_build_likelihood",
"(",
"self",
")",
":",
"pX",
"=",
"DiagonalGaussian",
"(",
"self",
".",
"X_mean",
",",
"self",
".",
"X_var",
")",
"num_inducing",
"=",
"len",
"(",
"self",
".",
"feature",
")",
"psi0",
"=",
"tf",
".",
"reduce_sum",
"(",
"expe... | Construct a tensorflow function to compute the bound on the marginal
likelihood. | [
"Construct",
"a",
"tensorflow",
"function",
"to",
"compute",
"the",
"bound",
"on",
"the",
"marginal",
"likelihood",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/gplvm.py#L123-L166 | train | Builds a tensorflow function to compute the bound on the marginallikelihood. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/models/gplvm.py | BayesianGPLVM._build_predict | def _build_predict(self, Xnew, full_cov=False):
"""
Compute the mean and variance of the latent function at some new points.
Note that this is very similar to the SGPR prediction, for which
there are notes in the SGPR notebook.
:param Xnew: Point to predict at.
"""
... | python | def _build_predict(self, Xnew, full_cov=False):
"""
Compute the mean and variance of the latent function at some new points.
Note that this is very similar to the SGPR prediction, for which
there are notes in the SGPR notebook.
:param Xnew: Point to predict at.
"""
... | [
"def",
"_build_predict",
"(",
"self",
",",
"Xnew",
",",
"full_cov",
"=",
"False",
")",
":",
"pX",
"=",
"DiagonalGaussian",
"(",
"self",
".",
"X_mean",
",",
"self",
".",
"X_var",
")",
"num_inducing",
"=",
"len",
"(",
"self",
".",
"feature",
")",
"psi1",... | Compute the mean and variance of the latent function at some new points.
Note that this is very similar to the SGPR prediction, for which
there are notes in the SGPR notebook.
:param Xnew: Point to predict at. | [
"Compute",
"the",
"mean",
"and",
"variance",
"of",
"the",
"latent",
"function",
"at",
"some",
"new",
"points",
".",
"Note",
"that",
"this",
"is",
"very",
"similar",
"to",
"the",
"SGPR",
"prediction",
"for",
"which",
"there",
"are",
"notes",
"in",
"the",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/models/gplvm.py#L169-L206 | train | Compute the mean and variance of the latent function at some new points. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/multioutput/conditionals.py | _conditional | def _conditional(Xnew, feat, kern, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False):
"""
Multi-output GP with independent GP priors.
Number of latent processes equals the number of outputs (L = P).
The covariance matrices used to calculate the conditional have the following shape:... | python | def _conditional(Xnew, feat, kern, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False):
"""
Multi-output GP with independent GP priors.
Number of latent processes equals the number of outputs (L = P).
The covariance matrices used to calculate the conditional have the following shape:... | [
"def",
"_conditional",
"(",
"Xnew",
",",
"feat",
",",
"kern",
",",
"f",
",",
"*",
",",
"full_cov",
"=",
"False",
",",
"full_output_cov",
"=",
"False",
",",
"q_sqrt",
"=",
"None",
",",
"white",
"=",
"False",
")",
":",
"logger",
".",
"debug",
"(",
"\... | Multi-output GP with independent GP priors.
Number of latent processes equals the number of outputs (L = P).
The covariance matrices used to calculate the conditional have the following shape:
- Kuu: P x M x M
- Kuf: P x M x N
- Kff: P x N or P x N x N
Further reference
-----------------
... | [
"Multi",
"-",
"output",
"GP",
"with",
"independent",
"GP",
"priors",
".",
"Number",
"of",
"latent",
"processes",
"equals",
"the",
"number",
"of",
"outputs",
"(",
"L",
"=",
"P",
")",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/multioutput/conditionals.py#L90-L133 | train | Returns a single - output conditional for a single - output case. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/multioutput/conditionals.py | _conditional | def _conditional(Xnew, feat, kern, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False):
"""
Multi-output GP with fully correlated inducing variables.
The inducing variables are shaped in the same way as evaluations of K, to allow a default
inducing point scheme for multi-output kernel... | python | def _conditional(Xnew, feat, kern, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False):
"""
Multi-output GP with fully correlated inducing variables.
The inducing variables are shaped in the same way as evaluations of K, to allow a default
inducing point scheme for multi-output kernel... | [
"def",
"_conditional",
"(",
"Xnew",
",",
"feat",
",",
"kern",
",",
"f",
",",
"*",
",",
"full_cov",
"=",
"False",
",",
"full_output_cov",
"=",
"False",
",",
"q_sqrt",
"=",
"None",
",",
"white",
"=",
"False",
")",
":",
"logger",
".",
"debug",
"(",
"\... | Multi-output GP with fully correlated inducing variables.
The inducing variables are shaped in the same way as evaluations of K, to allow a default
inducing point scheme for multi-output kernels.
The covariance matrices used to calculate the conditional have the following shape:
- Kuu: M x L x M x L
... | [
"Multi",
"-",
"output",
"GP",
"with",
"fully",
"correlated",
"inducing",
"variables",
".",
"The",
"inducing",
"variables",
"are",
"shaped",
"in",
"the",
"same",
"way",
"as",
"evaluations",
"of",
"K",
"to",
"allow",
"a",
"default",
"inducing",
"point",
"schem... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/multioutput/conditionals.py#L168-L209 | train | This function calculates the conditional for a single - output GP with fully correlated inducing variables. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/multioutput/conditionals.py | _conditional | def _conditional(Xnew, feat, kern, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False):
"""
Most efficient routine to project L independent latent gps through a mixing matrix W.
The mixing matrix is a member of the `SeparateMixedMok` and has shape P x L.
The covariance matrices used ... | python | def _conditional(Xnew, feat, kern, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False):
"""
Most efficient routine to project L independent latent gps through a mixing matrix W.
The mixing matrix is a member of the `SeparateMixedMok` and has shape P x L.
The covariance matrices used ... | [
"def",
"_conditional",
"(",
"Xnew",
",",
"feat",
",",
"kern",
",",
"f",
",",
"*",
",",
"full_cov",
"=",
"False",
",",
"full_output_cov",
"=",
"False",
",",
"q_sqrt",
"=",
"None",
",",
"white",
"=",
"False",
")",
":",
"logger",
".",
"debug",
"(",
"\... | Most efficient routine to project L independent latent gps through a mixing matrix W.
The mixing matrix is a member of the `SeparateMixedMok` and has shape P x L.
The covariance matrices used to calculate the conditional have the following shape:
- Kuu: L x M x M
- Kuf: L x M x N
- Kff: L x N or L ... | [
"Most",
"efficient",
"routine",
"to",
"project",
"L",
"independent",
"latent",
"gps",
"through",
"a",
"mixing",
"matrix",
"W",
".",
"The",
"mixing",
"matrix",
"is",
"a",
"member",
"of",
"the",
"SeparateMixedMok",
"and",
"has",
"shape",
"P",
"x",
"L",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/multioutput/conditionals.py#L214-L236 | train | This function computes the conditional of the current state of the current state of the current state. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/multioutput/conditionals.py | _sample_conditional | def _sample_conditional(Xnew, feat, kern, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False, num_samples=None):
"""
`sample_conditional` will return a sample from the conditinoal distribution.
In most cases this means calculating the conditional mean m and variance v and then
returni... | python | def _sample_conditional(Xnew, feat, kern, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False, num_samples=None):
"""
`sample_conditional` will return a sample from the conditinoal distribution.
In most cases this means calculating the conditional mean m and variance v and then
returni... | [
"def",
"_sample_conditional",
"(",
"Xnew",
",",
"feat",
",",
"kern",
",",
"f",
",",
"*",
",",
"full_cov",
"=",
"False",
",",
"full_output_cov",
"=",
"False",
",",
"q_sqrt",
"=",
"None",
",",
"white",
"=",
"False",
",",
"num_samples",
"=",
"None",
")",
... | `sample_conditional` will return a sample from the conditinoal distribution.
In most cases this means calculating the conditional mean m and variance v and then
returning m + sqrt(v) * eps, with eps ~ N(0, 1).
However, for some combinations of Mok and Mof more efficient sampling routines exists.
The dis... | [
"sample_conditional",
"will",
"return",
"a",
"sample",
"from",
"the",
"conditinoal",
"distribution",
".",
"In",
"most",
"cases",
"this",
"means",
"calculating",
"the",
"conditional",
"mean",
"m",
"and",
"variance",
"v",
"and",
"then",
"returning",
"m",
"+",
"s... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/multioutput/conditionals.py#L245-L267 | train | Sample from a conditional distribution. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/multioutput/conditionals.py | independent_interdomain_conditional | def independent_interdomain_conditional(Kmn, Kmm, Knn, f, *, full_cov=False, full_output_cov=False,
q_sqrt=None, white=False):
"""
The inducing outputs live in the g-space (R^L).
Interdomain conditional calculation.
:param Kmn: M x L x N x P
:param Kmm: L x M... | python | def independent_interdomain_conditional(Kmn, Kmm, Knn, f, *, full_cov=False, full_output_cov=False,
q_sqrt=None, white=False):
"""
The inducing outputs live in the g-space (R^L).
Interdomain conditional calculation.
:param Kmn: M x L x N x P
:param Kmm: L x M... | [
"def",
"independent_interdomain_conditional",
"(",
"Kmn",
",",
"Kmm",
",",
"Knn",
",",
"f",
",",
"*",
",",
"full_cov",
"=",
"False",
",",
"full_output_cov",
"=",
"False",
",",
"q_sqrt",
"=",
"None",
",",
"white",
"=",
"False",
")",
":",
"logger",
".",
... | The inducing outputs live in the g-space (R^L).
Interdomain conditional calculation.
:param Kmn: M x L x N x P
:param Kmm: L x M x M
:param Knn: N x P or N x N or P x N x N or N x P x N x P
:param f: data matrix, M x L
:param q_sqrt: L x M x M or M x L
:param full_cov: calculate cov... | [
"The",
"inducing",
"outputs",
"live",
"in",
"the",
"g",
"-",
"space",
"(",
"R^L",
")",
".",
"Interdomain",
"conditional",
"calculation",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/multioutput/conditionals.py#L274-L339 | train | Independent interdomain conditional calculation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/multioutput/conditionals.py | fully_correlated_conditional | def fully_correlated_conditional(Kmn, Kmm, Knn, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False):
"""
This function handles conditioning of multi-output GPs in the case where the conditioning
points are all fully correlated, in both the prior and posterior.
:param Kmn: LM x N x P
... | python | def fully_correlated_conditional(Kmn, Kmm, Knn, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False):
"""
This function handles conditioning of multi-output GPs in the case where the conditioning
points are all fully correlated, in both the prior and posterior.
:param Kmn: LM x N x P
... | [
"def",
"fully_correlated_conditional",
"(",
"Kmn",
",",
"Kmm",
",",
"Knn",
",",
"f",
",",
"*",
",",
"full_cov",
"=",
"False",
",",
"full_output_cov",
"=",
"False",
",",
"q_sqrt",
"=",
"None",
",",
"white",
"=",
"False",
")",
":",
"m",
",",
"v",
"=",
... | This function handles conditioning of multi-output GPs in the case where the conditioning
points are all fully correlated, in both the prior and posterior.
:param Kmn: LM x N x P
:param Kmm: LM x LM
:param Knn: N x P or N x P x N x P
:param f: data matrix, LM x 1
:param q_sqrt: 1 x LM x LM or 1... | [
"This",
"function",
"handles",
"conditioning",
"of",
"multi",
"-",
"output",
"GPs",
"in",
"the",
"case",
"where",
"the",
"conditioning",
"points",
"are",
"all",
"fully",
"correlated",
"in",
"both",
"the",
"prior",
"and",
"posterior",
".",
":",
"param",
"Kmn"... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/multioutput/conditionals.py#L342-L360 | train | This function handles the fully correlated conditional of multi - output GPs in the case where the conditioning of multi - output GPs is all fully correlated. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/multioutput/conditionals.py | fully_correlated_conditional_repeat | def fully_correlated_conditional_repeat(Kmn, Kmm, Knn, f, *, full_cov=False, full_output_cov=False, q_sqrt=None,
white=False):
"""
This function handles conditioning of multi-output GPs in the case where the conditioning
points are all fully correlated, in both the pr... | python | def fully_correlated_conditional_repeat(Kmn, Kmm, Knn, f, *, full_cov=False, full_output_cov=False, q_sqrt=None,
white=False):
"""
This function handles conditioning of multi-output GPs in the case where the conditioning
points are all fully correlated, in both the pr... | [
"def",
"fully_correlated_conditional_repeat",
"(",
"Kmn",
",",
"Kmm",
",",
"Knn",
",",
"f",
",",
"*",
",",
"full_cov",
"=",
"False",
",",
"full_output_cov",
"=",
"False",
",",
"q_sqrt",
"=",
"None",
",",
"white",
"=",
"False",
")",
":",
"logger",
".",
... | This function handles conditioning of multi-output GPs in the case where the conditioning
points are all fully correlated, in both the prior and posterior.
Note: This conditional can handle 'repetitions' R, given in `f` and `q_sqrt`.
:param Kmn: LM x N x P
:param Kmm: LM x LM
:param Knn: N x P or ... | [
"This",
"function",
"handles",
"conditioning",
"of",
"multi",
"-",
"output",
"GPs",
"in",
"the",
"case",
"where",
"the",
"conditioning",
"points",
"are",
"all",
"fully",
"correlated",
"in",
"both",
"the",
"prior",
"and",
"posterior",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/multioutput/conditionals.py#L363-L445 | train | This function handles the fully correlated conditional of multi - output GPs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/multioutput/conditionals.py | _mix_latent_gp | def _mix_latent_gp(W, g_mu, g_var, full_cov, full_output_cov):
r"""
Takes the mean and variance of an uncorrelated L-dimensional latent GP
and returns the mean and the variance of the mixed GP, `f = W g`,
where both f and g are GPs, with W having a shape [P, L]
:param W: [P, L]
:param g_mu: [..... | python | def _mix_latent_gp(W, g_mu, g_var, full_cov, full_output_cov):
r"""
Takes the mean and variance of an uncorrelated L-dimensional latent GP
and returns the mean and the variance of the mixed GP, `f = W g`,
where both f and g are GPs, with W having a shape [P, L]
:param W: [P, L]
:param g_mu: [..... | [
"def",
"_mix_latent_gp",
"(",
"W",
",",
"g_mu",
",",
"g_var",
",",
"full_cov",
",",
"full_output_cov",
")",
":",
"f_mu",
"=",
"tf",
".",
"tensordot",
"(",
"g_mu",
",",
"W",
",",
"[",
"[",
"-",
"1",
"]",
",",
"[",
"-",
"1",
"]",
"]",
")",
"# [..... | r"""
Takes the mean and variance of an uncorrelated L-dimensional latent GP
and returns the mean and the variance of the mixed GP, `f = W g`,
where both f and g are GPs, with W having a shape [P, L]
:param W: [P, L]
:param g_mu: [..., N, L]
:param g_var: [..., N, L] (full_cov = False) or [L, ..... | [
"r",
"Takes",
"the",
"mean",
"and",
"variance",
"of",
"an",
"uncorrelated",
"L",
"-",
"dimensional",
"latent",
"GP",
"and",
"returns",
"the",
"mean",
"and",
"the",
"variance",
"of",
"the",
"mixed",
"GP",
"f",
"=",
"W",
"g",
"where",
"both",
"f",
"and",... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/multioutput/conditionals.py#L452-L490 | train | r Makes the mean and variance of an uncorrelated L - dimensional latent GP
and returns the mean and variance of the mixed GP. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/params/parameter.py | Parameter.size | def size(self):
"""The size of this parameter, equivalent to self.value.size"""
return np.multiply.reduce(self.shape, dtype=np.int32) | python | def size(self):
"""The size of this parameter, equivalent to self.value.size"""
return np.multiply.reduce(self.shape, dtype=np.int32) | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"np",
".",
"multiply",
".",
"reduce",
"(",
"self",
".",
"shape",
",",
"dtype",
"=",
"np",
".",
"int32",
")"
] | The size of this parameter, equivalent to self.value.size | [
"The",
"size",
"of",
"this",
"parameter",
"equivalent",
"to",
"self",
".",
"value",
".",
"size"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/params/parameter.py#L158-L160 | train | The size of this parameter equivalent to self. value. size | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/params/parameter.py | Parameter.tf_compilation_index | def tf_compilation_index(self):
"""
Takes out index from the parameter's tensor name. E.g. parameter tensor name is
GPR-0000/kern/lengthscales, the method for that parameter will return '0000' index.
"""
if self.parameter_tensor is None:
return None
name = se... | python | def tf_compilation_index(self):
"""
Takes out index from the parameter's tensor name. E.g. parameter tensor name is
GPR-0000/kern/lengthscales, the method for that parameter will return '0000' index.
"""
if self.parameter_tensor is None:
return None
name = se... | [
"def",
"tf_compilation_index",
"(",
"self",
")",
":",
"if",
"self",
".",
"parameter_tensor",
"is",
"None",
":",
"return",
"None",
"name",
"=",
"self",
".",
"parameter_tensor",
".",
"name",
"return",
"name",
".",
"split",
"(",
"'-'",
",",
"1",
")",
"[",
... | Takes out index from the parameter's tensor name. E.g. parameter tensor name is
GPR-0000/kern/lengthscales, the method for that parameter will return '0000' index. | [
"Takes",
"out",
"index",
"from",
"the",
"parameter",
"s",
"tensor",
"name",
".",
"E",
".",
"g",
".",
"parameter",
"tensor",
"name",
"is",
"GPR",
"-",
"0000",
"/",
"kern",
"/",
"lengthscales",
"the",
"method",
"for",
"that",
"parameter",
"will",
"return",... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/params/parameter.py#L309-L317 | train | Takes out index from the parameter s tensor name. E. g. parameter tensor name is
GPR - 0 - 0 - lengthcales | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/params/parameter.py | Parameter._build_prior | def _build_prior(self, unconstrained_tensor, constrained_tensor):
"""
Build a tensorflow representation of the prior density.
The log Jacobian is included.
"""
if not misc.is_tensor(unconstrained_tensor):
raise GPflowError("Unconstrained input must be a tensor.")
... | python | def _build_prior(self, unconstrained_tensor, constrained_tensor):
"""
Build a tensorflow representation of the prior density.
The log Jacobian is included.
"""
if not misc.is_tensor(unconstrained_tensor):
raise GPflowError("Unconstrained input must be a tensor.")
... | [
"def",
"_build_prior",
"(",
"self",
",",
"unconstrained_tensor",
",",
"constrained_tensor",
")",
":",
"if",
"not",
"misc",
".",
"is_tensor",
"(",
"unconstrained_tensor",
")",
":",
"raise",
"GPflowError",
"(",
"\"Unconstrained input must be a tensor.\"",
")",
"if",
"... | Build a tensorflow representation of the prior density.
The log Jacobian is included. | [
"Build",
"a",
"tensorflow",
"representation",
"of",
"the",
"prior",
"density",
".",
"The",
"log",
"Jacobian",
"is",
"included",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/params/parameter.py#L403-L421 | train | Builds a tensorflow representation of the prior density. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/external_optimizer.py | ExternalOptimizerInterface.minimize | def minimize(self,
session=None,
feed_dict=None,
fetches=None,
step_callback=None,
loss_callback=None,
**run_kwargs):
"""Minimize a scalar `Tensor`.
Variables subject to optimization are updated in-place at the end of
... | python | def minimize(self,
session=None,
feed_dict=None,
fetches=None,
step_callback=None,
loss_callback=None,
**run_kwargs):
"""Minimize a scalar `Tensor`.
Variables subject to optimization are updated in-place at the end of
... | [
"def",
"minimize",
"(",
"self",
",",
"session",
"=",
"None",
",",
"feed_dict",
"=",
"None",
",",
"fetches",
"=",
"None",
",",
"step_callback",
"=",
"None",
",",
"loss_callback",
"=",
"None",
",",
"*",
"*",
"run_kwargs",
")",
":",
"session",
"=",
"sessi... | Minimize a scalar `Tensor`.
Variables subject to optimization are updated in-place at the end of
optimization.
Note that this method does *not* just return a minimization `Op`, unlike
`Optimizer.minimize()`; instead it actually performs minimization by
executing commands to control a `Session`.
... | [
"Minimize",
"a",
"scalar",
"Tensor",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/external_optimizer.py#L108-L184 | train | Minimizes a scalar Tensor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/external_optimizer.py | ExternalOptimizerInterface._minimize | def _minimize(self, initial_val, loss_grad_func, equality_funcs,
equality_grad_funcs, inequality_funcs, inequality_grad_funcs,
packed_bounds, step_callback, optimizer_kwargs):
"""Wrapper for a particular optimization algorithm implementation.
It would be appropriate for a subcla... | python | def _minimize(self, initial_val, loss_grad_func, equality_funcs,
equality_grad_funcs, inequality_funcs, inequality_grad_funcs,
packed_bounds, step_callback, optimizer_kwargs):
"""Wrapper for a particular optimization algorithm implementation.
It would be appropriate for a subcla... | [
"def",
"_minimize",
"(",
"self",
",",
"initial_val",
",",
"loss_grad_func",
",",
"equality_funcs",
",",
"equality_grad_funcs",
",",
"inequality_funcs",
",",
"inequality_grad_funcs",
",",
"packed_bounds",
",",
"step_callback",
",",
"optimizer_kwargs",
")",
":",
"raise"... | Wrapper for a particular optimization algorithm implementation.
It would be appropriate for a subclass implementation of this method to
raise `NotImplementedError` if unsupported arguments are passed: e.g. if an
algorithm does not support constraints but `len(equality_funcs) > 0`.
Args:
initial_... | [
"Wrapper",
"for",
"a",
"particular",
"optimization",
"algorithm",
"implementation",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/external_optimizer.py#L248-L278 | train | Wrapper for the external optimizer interface to minimize an internal key - value vector. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/external_optimizer.py | ExternalOptimizerInterface._pack | def _pack(cls, tensors):
"""Pack a list of `Tensor`s into a single, flattened, rank-1 `Tensor`."""
if not tensors:
return None
elif len(tensors) == 1:
return array_ops.reshape(tensors[0], [-1])
else:
flattened = [array_ops.reshape(tensor, [-1]) for tensor in tensors]
return array... | python | def _pack(cls, tensors):
"""Pack a list of `Tensor`s into a single, flattened, rank-1 `Tensor`."""
if not tensors:
return None
elif len(tensors) == 1:
return array_ops.reshape(tensors[0], [-1])
else:
flattened = [array_ops.reshape(tensor, [-1]) for tensor in tensors]
return array... | [
"def",
"_pack",
"(",
"cls",
",",
"tensors",
")",
":",
"if",
"not",
"tensors",
":",
"return",
"None",
"elif",
"len",
"(",
"tensors",
")",
"==",
"1",
":",
"return",
"array_ops",
".",
"reshape",
"(",
"tensors",
"[",
"0",
"]",
",",
"[",
"-",
"1",
"]"... | Pack a list of `Tensor`s into a single, flattened, rank-1 `Tensor`. | [
"Pack",
"a",
"list",
"of",
"Tensor",
"s",
"into",
"a",
"single",
"flattened",
"rank",
"-",
"1",
"Tensor",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/external_optimizer.py#L281-L289 | train | Pack a list of Tensor s into a single flattened rank - 1 Tensor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/external_optimizer.py | ExternalOptimizerInterface._make_eval_func | def _make_eval_func(self, tensors, session, feed_dict, fetches,
callback=None):
"""Construct a function that evaluates a `Tensor` or list of `Tensor`s."""
if not isinstance(tensors, list):
tensors = [tensors]
num_tensors = len(tensors)
def eval_func(x):
"""Function to ... | python | def _make_eval_func(self, tensors, session, feed_dict, fetches,
callback=None):
"""Construct a function that evaluates a `Tensor` or list of `Tensor`s."""
if not isinstance(tensors, list):
tensors = [tensors]
num_tensors = len(tensors)
def eval_func(x):
"""Function to ... | [
"def",
"_make_eval_func",
"(",
"self",
",",
"tensors",
",",
"session",
",",
"feed_dict",
",",
"fetches",
",",
"callback",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"tensors",
",",
"list",
")",
":",
"tensors",
"=",
"[",
"tensors",
"]",
"num... | Construct a function that evaluates a `Tensor` or list of `Tensor`s. | [
"Construct",
"a",
"function",
"that",
"evaluates",
"a",
"Tensor",
"or",
"list",
"of",
"Tensor",
"s",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/external_optimizer.py#L291-L316 | train | Construct a function that evaluates a Tensor or list of Tensors. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/monitor.py | create_global_step | def create_global_step(session: tf.Session) -> tf.Variable:
"""
Creates the Tensorflow 'global_step' variable (see `MonitorContext.global_step_tensor`).
:param session: Tensorflow session the optimiser is running in
:return: The variable tensor.
"""
global_step_tensor = tf.Variable(0, trainable=... | python | def create_global_step(session: tf.Session) -> tf.Variable:
"""
Creates the Tensorflow 'global_step' variable (see `MonitorContext.global_step_tensor`).
:param session: Tensorflow session the optimiser is running in
:return: The variable tensor.
"""
global_step_tensor = tf.Variable(0, trainable=... | [
"def",
"create_global_step",
"(",
"session",
":",
"tf",
".",
"Session",
")",
"->",
"tf",
".",
"Variable",
":",
"global_step_tensor",
"=",
"tf",
".",
"Variable",
"(",
"0",
",",
"trainable",
"=",
"False",
",",
"name",
"=",
"\"global_step\"",
")",
"session",
... | Creates the Tensorflow 'global_step' variable (see `MonitorContext.global_step_tensor`).
:param session: Tensorflow session the optimiser is running in
:return: The variable tensor. | [
"Creates",
"the",
"Tensorflow",
"global_step",
"variable",
"(",
"see",
"MonitorContext",
".",
"global_step_tensor",
")",
".",
":",
"param",
"session",
":",
"Tensorflow",
"session",
"the",
"optimiser",
"is",
"running",
"in",
":",
"return",
":",
"The",
"variable",... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/monitor.py#L131-L139 | train | Creates the Tensorflow global_step variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/monitor.py | restore_session | def restore_session(session: tf.Session, checkpoint_dir: str,
saver: Optional[tf.train.Saver] = None) -> None:
"""
Restores Tensorflow session from the latest checkpoint.
:param session: The TF session
:param checkpoint_dir: checkpoint files directory.
:param saver: The saver obj... | python | def restore_session(session: tf.Session, checkpoint_dir: str,
saver: Optional[tf.train.Saver] = None) -> None:
"""
Restores Tensorflow session from the latest checkpoint.
:param session: The TF session
:param checkpoint_dir: checkpoint files directory.
:param saver: The saver obj... | [
"def",
"restore_session",
"(",
"session",
":",
"tf",
".",
"Session",
",",
"checkpoint_dir",
":",
"str",
",",
"saver",
":",
"Optional",
"[",
"tf",
".",
"train",
".",
"Saver",
"]",
"=",
"None",
")",
"->",
"None",
":",
"checkpoint_path",
"=",
"tf",
".",
... | Restores Tensorflow session from the latest checkpoint.
:param session: The TF session
:param checkpoint_dir: checkpoint files directory.
:param saver: The saver object, if not provided a default saver object will be created. | [
"Restores",
"Tensorflow",
"session",
"from",
"the",
"latest",
"checkpoint",
".",
":",
"param",
"session",
":",
"The",
"TF",
"session",
":",
"param",
"checkpoint_dir",
":",
"checkpoint",
"files",
"directory",
".",
":",
"param",
"saver",
":",
"The",
"saver",
"... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/monitor.py#L142-L156 | train | Restores Tensorflow session from the latest checkpoint. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/monitor.py | get_default_saver | def get_default_saver(max_to_keep: int=3) -> tf.train.Saver:
"""
Creates Tensorflow Saver object with 3 recent checkpoints to keep.
:param max_to_keep: Maximum number of recent checkpoints to keep, defaults to 3
"""
return tf.train.Saver(max_to_keep=max_to_keep) | python | def get_default_saver(max_to_keep: int=3) -> tf.train.Saver:
"""
Creates Tensorflow Saver object with 3 recent checkpoints to keep.
:param max_to_keep: Maximum number of recent checkpoints to keep, defaults to 3
"""
return tf.train.Saver(max_to_keep=max_to_keep) | [
"def",
"get_default_saver",
"(",
"max_to_keep",
":",
"int",
"=",
"3",
")",
"->",
"tf",
".",
"train",
".",
"Saver",
":",
"return",
"tf",
".",
"train",
".",
"Saver",
"(",
"max_to_keep",
"=",
"max_to_keep",
")"
] | Creates Tensorflow Saver object with 3 recent checkpoints to keep.
:param max_to_keep: Maximum number of recent checkpoints to keep, defaults to 3 | [
"Creates",
"Tensorflow",
"Saver",
"object",
"with",
"3",
"recent",
"checkpoints",
"to",
"keep",
".",
":",
"param",
"max_to_keep",
":",
"Maximum",
"number",
"of",
"recent",
"checkpoints",
"to",
"keep",
"defaults",
"to",
"3"
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/monitor.py#L159-L164 | train | Returns a Tensorflow Saver object with default values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/monitor.py | update_optimiser | def update_optimiser(context, *args, **kwargs) -> None:
"""
Writes optimiser state into corresponding TensorFlow variables. This may need to be done
for optimisers like ScipyOptimiser that work with their own copies of the variables.
Normally the source variables would be updated only when the optimiser... | python | def update_optimiser(context, *args, **kwargs) -> None:
"""
Writes optimiser state into corresponding TensorFlow variables. This may need to be done
for optimisers like ScipyOptimiser that work with their own copies of the variables.
Normally the source variables would be updated only when the optimiser... | [
"def",
"update_optimiser",
"(",
"context",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"->",
"None",
":",
"if",
"context",
".",
"optimiser",
"is",
"None",
"or",
"context",
".",
"optimiser_updated",
":",
"return",
"if",
"isinstance",
"(",
"context",
"... | Writes optimiser state into corresponding TensorFlow variables. This may need to be done
for optimisers like ScipyOptimiser that work with their own copies of the variables.
Normally the source variables would be updated only when the optimiser has finished the
minimisation. This function may be called from... | [
"Writes",
"optimiser",
"state",
"into",
"corresponding",
"TensorFlow",
"variables",
".",
"This",
"may",
"need",
"to",
"be",
"done",
"for",
"optimisers",
"like",
"ScipyOptimiser",
"that",
"work",
"with",
"their",
"own",
"copies",
"of",
"the",
"variables",
".",
... | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/monitor.py#L167-L195 | train | Updates the state of the current state of the current optimiser. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/monitor.py | MonitorContext.global_step | def global_step(self) -> int:
"""
Evaluates the value of the global step variable if it is set, otherwise returns the
current iteration number.
"""
if self.session is None or self.global_step_tensor is None:
return self.iteration_no + self.init_global_step
els... | python | def global_step(self) -> int:
"""
Evaluates the value of the global step variable if it is set, otherwise returns the
current iteration number.
"""
if self.session is None or self.global_step_tensor is None:
return self.iteration_no + self.init_global_step
els... | [
"def",
"global_step",
"(",
"self",
")",
"->",
"int",
":",
"if",
"self",
".",
"session",
"is",
"None",
"or",
"self",
".",
"global_step_tensor",
"is",
"None",
":",
"return",
"self",
".",
"iteration_no",
"+",
"self",
".",
"init_global_step",
"else",
":",
"r... | Evaluates the value of the global step variable if it is set, otherwise returns the
current iteration number. | [
"Evaluates",
"the",
"value",
"of",
"the",
"global",
"step",
"variable",
"if",
"it",
"is",
"set",
"otherwise",
"returns",
"the",
"current",
"iteration",
"number",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/monitor.py#L238-L246 | train | Evaluates the value of the global step variable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/monitor.py | MonitorTask.with_condition | def with_condition(self, condition: Callable[[MonitorContext], bool]) -> 'MonitorTask':
"""
Sets the task running condition that will be evaluated during the optimisation cycle.
"""
self._condition = condition
return self | python | def with_condition(self, condition: Callable[[MonitorContext], bool]) -> 'MonitorTask':
"""
Sets the task running condition that will be evaluated during the optimisation cycle.
"""
self._condition = condition
return self | [
"def",
"with_condition",
"(",
"self",
",",
"condition",
":",
"Callable",
"[",
"[",
"MonitorContext",
"]",
",",
"bool",
"]",
")",
"->",
"'MonitorTask'",
":",
"self",
".",
"_condition",
"=",
"condition",
"return",
"self"
] | Sets the task running condition that will be evaluated during the optimisation cycle. | [
"Sets",
"the",
"task",
"running",
"condition",
"that",
"will",
"be",
"evaluated",
"during",
"the",
"optimisation",
"cycle",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/monitor.py#L280-L285 | train | Sets the condition that will be evaluated during the optimisation cycle. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
GPflow/GPflow | gpflow/training/monitor.py | MonitorTask.with_exit_condition | def with_exit_condition(self, exit_condition: Optional[bool]=True) -> 'MonitorTask':
"""
Sets the flag indicating that the task should also run after the optimisation is ended.
"""
self._exit_condition = exit_condition
return self | python | def with_exit_condition(self, exit_condition: Optional[bool]=True) -> 'MonitorTask':
"""
Sets the flag indicating that the task should also run after the optimisation is ended.
"""
self._exit_condition = exit_condition
return self | [
"def",
"with_exit_condition",
"(",
"self",
",",
"exit_condition",
":",
"Optional",
"[",
"bool",
"]",
"=",
"True",
")",
"->",
"'MonitorTask'",
":",
"self",
".",
"_exit_condition",
"=",
"exit_condition",
"return",
"self"
] | Sets the flag indicating that the task should also run after the optimisation is ended. | [
"Sets",
"the",
"flag",
"indicating",
"that",
"the",
"task",
"should",
"also",
"run",
"after",
"the",
"optimisation",
"is",
"ended",
"."
] | 549394f0b1b0696c7b521a065e49bdae6e7acf27 | https://github.com/GPflow/GPflow/blob/549394f0b1b0696c7b521a065e49bdae6e7acf27/gpflow/training/monitor.py#L287-L292 | train | Sets the flag indicating that the task should also run after the optimisation is ended. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.