- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.deeplearning4j.zoo.ZooModel.initPretrained()
方法的一些代码示例,展示了ZooModel.initPretrained()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooModel.initPretrained()
方法的具体详情如下:
包路径:org.deeplearning4j.zoo.ZooModel
类名称:ZooModel
方法名:initPretrained
[英]By default, will return a pretrained ImageNet if available.
[中]默认情况下,将返回预训练的ImageNet(如果可用)。
代码示例来源:origin: deeplearning4j/dl4j-examples
public static void main(String [] args) throws UnsupportedKerasConfigurationException, IOException, InvalidKerasConfigurationException {
//import org.deeplearning4j.transferlearning.vgg16 and print summary
LOGGER.info("\n\nLoading org.deeplearning4j.transferlearning.vgg16...\n\n");
ZooModel zooModel = VGG16.builder().build();
ComputationGraph vgg16 = (ComputationGraph) zooModel.initPretrained();
LOGGER.info(vgg16.summary());
//use the TransferLearningHelper to freeze the specified vertices and below
//NOTE: This is done in place! Pass in a cloned version of the model if you would prefer to not do this in place
TransferLearningHelper transferLearningHelper = new TransferLearningHelper(vgg16, featurizeExtractionLayer);
LOGGER.info(vgg16.summary());
FlowerDataSetIterator.setup(batchSize,trainPerc);
DataSetIterator trainIter = FlowerDataSetIterator.trainIterator();
DataSetIterator testIter = FlowerDataSetIterator.testIterator();
int trainDataSaved = 0;
while(trainIter.hasNext()) {
DataSet currentFeaturized = transferLearningHelper.featurize(trainIter.next());
saveToDisk(currentFeaturized,trainDataSaved,true);
trainDataSaved++;
}
int testDataSaved = 0;
while(testIter.hasNext()) {
DataSet currentFeaturized = transferLearningHelper.featurize(testIter.next());
saveToDisk(currentFeaturized,testDataSaved,false);
testDataSaved++;
}
LOGGER.info("Finished pre saving featurized test and train data");
}
代码示例来源:origin: deeplearning4j/dl4j-examples
public static void main(String [] args) throws UnsupportedKerasConfigurationException, IOException, InvalidKerasConfigurationException {
//import org.deeplearning4j.transferlearning.vgg16 and print summary
LOGGER.info("\n\nLoading org.deeplearning4j.transferlearning.vgg16...\n\n");
ZooModel zooModel = VGG16.builder().build();
ComputationGraph vgg16 = (ComputationGraph) zooModel.initPretrained();
LOGGER.info(vgg16.summary());
//use the TransferLearningHelper to freeze the specified vertices and below
//NOTE: This is done in place! Pass in a cloned version of the model if you would prefer to not do this in place
TransferLearningHelper transferLearningHelper = new TransferLearningHelper(vgg16, featurizeExtractionLayer);
LOGGER.info(vgg16.summary());
FlowerDataSetIterator.setup(batchSize,trainPerc);
DataSetIterator trainIter = FlowerDataSetIterator.trainIterator();
DataSetIterator testIter = FlowerDataSetIterator.testIterator();
int trainDataSaved = 0;
while(trainIter.hasNext()) {
DataSet currentFeaturized = transferLearningHelper.featurize(trainIter.next());
saveToDisk(currentFeaturized,trainDataSaved,true);
trainDataSaved++;
}
int testDataSaved = 0;
while(testIter.hasNext()) {
DataSet currentFeaturized = transferLearningHelper.featurize(testIter.next());
saveToDisk(currentFeaturized,testDataSaved,false);
testDataSaved++;
}
LOGGER.info("Finished pre saving featurized test and train data");
}
代码示例来源:origin: deeplearning4j/dl4j-examples
ComputationGraph vgg16 = (ComputationGraph) zooModel.initPretrained();
log.info(vgg16.summary());
代码示例来源:origin: deeplearning4j/dl4j-examples
ComputationGraph vgg16 = (ComputationGraph) zooModel.initPretrained();
log.info(vgg16.summary());
代码示例来源:origin: apache/tika
@Override
public void initialize(Map<String, Param> params) throws TikaConfigException {
try {
if (serialize) {
if (cacheDir.exists()) {
model = ModelSerializer.restoreComputationGraph(cacheDir);
LOG.info("Preprocessed Model Loaded from {}", cacheDir);
} else {
LOG.warn("Preprocessed Model doesn't exist at {}", cacheDir);
cacheDir.getParentFile().mkdirs();
ZooModel zooModel = VGG16.builder().build();
model = (ComputationGraph)zooModel.initPretrained(PretrainedType.IMAGENET);
LOG.info("Saving the Loaded model for future use. Saved models are more optimised to consume less resources.");
ModelSerializer.writeModel(model, cacheDir, true);
}
} else {
LOG.info("Weight graph model loaded via dl4j Helper functions");
ZooModel zooModel = VGG16.builder().build();
model = (ComputationGraph)zooModel.initPretrained(PretrainedType.IMAGENET);
}
imageNetLabels = new ImageNetLabels();
available = true;
} catch (Exception e) {
available = false;
LOG.warn(e.getMessage(), e);
throw new TikaConfigException(e.getMessage(), e);
}
}
代码示例来源:origin: org.deeplearning4j/deeplearning4j-zoo
/**
* By default, will return a pretrained ImageNet if available.
*
* @return
* @throws IOException
*/
public Model initPretrained() throws IOException {
return initPretrained(PretrainedType.IMAGENET);
}
代码示例来源:origin: sjsdfg/dl4j-tutorials
private ComputationGraph loadModel() throws IOException {
ZooModel zooModel = VGG16.builder().build();
ComputationGraph vgg16 = (ComputationGraph) zooModel.initPretrained(PretrainedType.IMAGENET);
vgg16.initGradientsView();
log.info(vgg16.summary());
return vgg16;
}
代码示例来源:origin: sjsdfg/dl4j-tutorials
ComputationGraph vgg16 = (ComputationGraph) zooModel.initPretrained();
我一直在使用 apache Zookeeper,并被要求阅读包含以下属性的 Zoo.cfg: tickTime=2000 dataDir=/var/lib/zookeeper clientPort=2
我一直需要获取交易数据并按天、周、月、季度、年进行汇总——本质上,它是时间序列数据。我开始申请zoo/xts到我的数据,希望我可以更快地聚合数据,但我要么不完全理解包的目的,要么我试图不正确地应用它。
我有一个按时索引的动物园数据集。有些行有相同的数据,所以我基本上只想删除这些重复的行。 redpardiff relpar 2012-07-
本文整理了Java中org.deeplearning4j.zoo.ZooModel类的一些代码示例,展示了ZooModel类的具体用法。这些代码示例主要来源于Github/Stackoverflow/
我想使用动物园函数 rollapply 在时间序列上应用函数(例如平均值),但只使用最后 N 个已知点。例如: x = zoo(c(1,2,3,4), order.by=c(10,11,12,13))
我找遍了所有地方,但我找不到以前问过这个问题的地方。 将这些数据放入适当的动物园系列的干净方法是什么?这个版本是复制/粘贴,使这篇文章更容易,但它总是以下表的形式出现(来自文本文件)。我的 read.
我有一个动物园时间序列: z str(z) ‘zoo’ series from (03/27/10 21:00:00) to (03/28/10 07:00:00) Data: num [1:1
在R中,如何为新类实现运算符重载(如+,-,*,./)?我在ops.R中检查了动物园图书馆的源代码。以下代码能完成这项工作吗? Ops.zoo `+.mychar` x y class(x)
我和我的同事有两个数据集,每个数据集每天有 1 个观察值,但是天数在每个数据集中不连续,并且在两个数据集之间不一致。 我们将每个转换为一个动物园对象并合并,从时间索引中删除那些日子在第二个数据集中有观
数据看起来像 Time Set1 Set2 10:19:38.551629 16234 16236 10:19:41.408010 16234 16236
我很困惑为什么不能 Select x.continent, x.name From world x Where x.name <= ALL (select y.name from world y wh
我正在使用 joomla 3,zoo 组件。 在系统后端,我有以下代码来显示安装的每个动物园应用程序中的项目数量: getItemCount(); ?> 我需要编辑此代码以仅显示“已发布”的项目数量。
我在 joomla component zoo 工作。我需要的是在项目布局中呈现这个项目 ID。 我可以获取所有动物园项目 ID 的列表,但无法找到如何获取 $this('id') 我不能使用菜单 I
我试图了解我过去在输入动物园对象时遇到的困难。尽管 tz 的默认参数应该是 "",但 read.zoo 的以下两种用法给出了不同的结果,这是两个 read.zoo 调用之间的唯一区别: Lines
我有看起来像这样的数据: > head(data) groupname ob_time dist.mean dist.sd dur.mean dur.sd c
我有多个时间序列数据图,我需要在每个图中有一条水平线,但具有不同的水平值(例如,第一个图:h=50,第二个图:h=48 ...)。 我试过 abline(h=50...我在每个图中都得到了水平线。 我
我有一个 yearmon 对象: require(zoo) date1 format(date1, "%b") ## Month, char, abbreviated [1] "Mar" > for
我很高兴使用这段代码运行: z=lapply(filename_list, function(fname){ read.zoo(file=fname,header=TRUE,sep = ","
我正在使用 R 中的 zoo 包来分析时间序列数据。我有以下数据文件: Date(dd-mm-yy),Time(hh:mm:ss),Julian_Day,AOT_1640,AOT_1020,AOT_8
TF Objection Detection Zoo 中的模型有 meta+ckpt 文件、Frozen.pb 文件和 Saved_model 文件。 我尝试使用 meta+ckpt 文件进一步训练,
我是一名优秀的程序员,十分优秀!