我知道在keras中有Conv2DTranspose可用于Image.我们需要在NLP中使用它,因此需要一维反卷积.
我们如何在keras中实现Conv1DTranspose?
我用ubuntu.
我启动三个mongod副本集如下:
$ mongod --replSet setname --logpath "1.log" --dbpath /data/rs1 --port 27017 --smallfiles --fork
$ mongod --replSet setname --logpath "2.log" --dbpath /data/rs2 --port 27018 --smallfiles --fork
$ mongod --replSet setname --logpath "3.log" --dbpath /data/rs3 --port 27019 --smallfiles --fork
Run Code Online (Sandbox Code Playgroud)
我该如何关闭它们?
String是一个模块,str是一个类型.我发现str有方法,而str的一些方法与string相同.
>>>dir(str)
['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__',
'__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__',
'__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',
'__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__',
'__subclasshook__', '_formatter_field_name_split', '_formatter_parser',
'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
'find', 'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace',
'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split',
'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper',
'zfill']
>>> dir(string)
['Formatter', 'Template', '_TemplateMetaclass', '__builtins__', '__doc__', …Run Code Online (Sandbox Code Playgroud) 我知道有一个名为pylzma的模块.但它只支持lzma,而不支持lzma2.
我目前的解决方案是subprocess.call()用来调用7z程序.
有没有更好的办法?
我有一段代码来处理命令行参数.
def parse_cmd_args():
input_path = None
output_name = 'out.flv.txt'
is_detail = False
try:
opts, args = getopt.getopt(sys.argv[1:], "hi:o:d")
except getopt.GetoptError:
print 'Usage:'
print 'parse_flv -i input_path -o [output_name]'
sys.exit()
for op, value in opts:
if op == '-i':
input_path = value
elif op == '-o':
output_name = value
elif op == '-d':
is_detail = True
elif op == '-h':
print 'Usage:'
print 'parse_flv -i input_path [-o output_name]'
sys.exit()
return os.path.abspath(input_path), output_name, is_detail
Run Code Online (Sandbox Code Playgroud)
如果我输入这样的命令without a option symbol '-':
python …Run Code Online (Sandbox Code Playgroud) python ×3
7zip ×1
compression ×1
getopt ×1
keras ×1
keras-layer ×1
lzma ×1
methods ×1
mongodb ×1
string ×1