相关推荐
腾讯WeKnora开源了!手把手教你用Docker+Ollama本地部署多模态知识库(附避坑指南)
本文详细介绍了腾讯开源的多模态知识库工具WeKnora的本地部署方法,通过Docker和Ollama实现完全离线运行。文章包含环境准备、核心组件配置、Ollama模型集成、系统启动验证及高级性能调优等实战内容,特别适合需要构建私有化知识库的中小团队和个人开发者。
使用ActivityLifecycleCallbacks监听前后台,获取当前Activity
一、ActivityLifecycleCallbacks接口介绍 API 14之后,在Application类中,提供了一个应用生命周期回调的注册方法,用来对应用的生命周期进行集中管理,这个接口叫registerActivityLifecycleCallbacks,可以通过它注册自己的ActivityLifeCycleCallback,每一个Activity的生命周期都会回调到这里的对应方法。 A...
中山大学_数据科学与计算机_预推免
前言 2019 年 9 月中旬是中山大学预推免时间,本人没能进到夏令营,但是最后在预推免上岸也算不幸中的万幸。 记忆不一定准确,但希望能帮到他人。 想看 流程 的可以直接看总结,正文部分有本人心路历程。 预推免 中山大学的预推免大致可以分为 报道,机试,面试 三大部分,而且尤其是面试,所有人加起来总时长 3 天,幸运的是,本人被安排在第一天的下午第一场,上午就是机试,报道,机试,面试,无缝衔接。 ...
优雅的使用ActivityLifecycleCallbacks管理Activity和区分App前后台
一、ActivityLifecycleCallbacks接口介绍API 14之后,在Application类中,提供了一个应用生命周期回调的注册方法,用来对应用的生命周期进行集中管理,这个接口叫registerActivityLifecycleCallbacks,可以通过它注册自己的ActivityLifeCycleCallback,每一个Activity的生命周期都会回调到这里的对应方法。之前我们
手把手教你用QEMU模拟AST2600-EVB开发板:OpenBMC环境搭建全流程
本文提供了一份详尽的实战指南,手把手教你使用QEMU模拟器搭建AST2600-EVB开发板的OpenBMC环境。内容涵盖从工具链准备、系统镜像获取(官方与自编译),到QEMU启动命令解析、网络配置(用户与桥接模式),以及通过SSH、WebUI和Redfish API访问服务的全流程,帮助开发者在个人电脑上快速构建安全、可复现的嵌入式开发与测试沙盒。
DASH 流媒体协议(Dynamic Adaptive Streaming over HTTP)概述——起源、MPD文件解析、相关项目
简单介绍DASH的起源与发展、MPD文件简要解析、相关项目,以及常见流媒体协议的比较
Android应用前后台切换监听,借助ActivityLifecycleCallbacks实现
有时需要监听到应用在前后台切换并做些处理,一般的做法可能是建立一个BaseActivity,然后全部的Activity都继承它,在BaseActivity的onStart和onStop中计数去处理。这样并不是最好的方式,不做详细介绍,有更好的方式,道理其实差不多,就是借助ActivityLifecycleCallbacks来实现。 一、写了个帮助类: package com.dway.he
Matlab2018a崩溃解决的办法No sandbox or build area path
Matlab 2018a (No sandbox or build area path)出现崩溃后需要使用terminal进行如下操作: cd /home/david/MySoft/MATLAB/R2018a/bin/glnxa64 (你的matlab路径) mkdir exclude mv libfreetype* exclude/ 执行后图片如下: 如果你用的Windows系统,请手动按照上面步骤剔除了dll。 Matlab 2018a (No sandbox or build are
Android 使用 Application.ActivityLifecycleCallbacks 来判断应用前后台状态的监听
Android 使用 Application.ActivityLifecycleCallbacks 来处理应用前后台切换状态的监听: package com.windfallsheng.base; import android.app.Activity; import android.app.Application; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Null
DeepSpeed Zero3 Offload实战:从GCC版本检查到环境配置的完整避坑指南
本文是一份针对DeepSpeed Zero3 Offload部署的完整避坑指南。针对训练中常见的`AttributeError: ‘DeepSpeedCPUAdam‘ object has no attribute ‘ds_opt_adam`报错,文章深入剖析了其根源在于GCC编译器版本过低。指南提供了从系统GCC版本深度探查、安全启用高版本GCC环境,到DeepSpeed一致性安装验证的全链路实战方案,旨在帮助用户构建稳定的大模型训练环境。
华为OD面试八股真题 - 操作系统相关 - 2
华为OD技术面,操作系统相关八股真题提供详细解答,这篇博客主要涉及于进程和线程相关知识点
利用ActivityLifecycleCallbacks实现前后台进程切换
ActivityLifecycleCallbacks是4.0新增的一个接口,它管理着整个app的所有Activity的生命周期,也就是任何一个Activity只要走了生命周期就会回调这个接口中相应的方法,我们利用它可以做很多事情。 最新有个产品需求就是记录App进程从后台进入前台的情况,然后记录埋点,ok先奉上实现代码。registerActivityLifecycleCallbacks(new
指纹浏览器降维打击(下):Cloudflare Turnstile 与 hCaptcha 的底层交互逻辑
本文将深度拆解:Turnstile 与 hCaptcha 的 Iframe 沙箱通信机制,动态混淆 JS 与 PoW(工作量证明)的物理破解法则,以及如何通过 C++ 底层事件合成与环境基因强绑定,实现验证码的“无感过验”。
android 使用ActivityLifecycleCallbacks管理activity
Application通过此接口提供了一套回调方法,用于让开发者对Activity的生命周期事件进行集中处理。public class BaseApplication extends Application { private static final String TAG = "BaseApplication"; private static BaseApplication
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
IEM模型,地表粗糙度模拟
利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟
线程
线程 线程和进程 1.什么是进程 对于操作系统来说,一个进程就是一个应用程序,多进程就是多个程序同时运行罢了. 2.什么是线程 线程就是相对于进程而说的,一个进程包括很多线程.例如一个360杀毒软件,里面有杀毒,有清理内存垃圾等多个线程.因此线程是资源分配的最小单位,也是CPU调度的最小单位. 线程主要分为五大方面: (1)线程的创建方式 这里主要讲两种创建方法 1.继承Thread方法;重写Th...
锂电池充电器电路设计 里面有电路
锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。
Android如何实现NoActionBar以及Theme.NoTitleBar.Fullscreen效果
效果一 NoActionBar 无论Activity继承自Activity还是AppCompatActivity 只需要在styles中的修改Theme <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. -->...
Android软键盘弹出时,覆盖布局,不是把布局顶上去的解决方法
方法一: 在你的activity中的oncreate中setContentView之前写上这个代码 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); 方法二: 如果想activity页面整体上移,在项目的AndroidManifest.xml文件中界面对应的里加入 android:windowSoftInputMode="stateVisible|adjustResize" 如果想键盘覆盖在ac
android微信分享之视频、URL地址、表情分享
android微信分享之视频、URL地址、表情分享 1、视频分享 1、创建WXVideoObject对象,用于指向视频URL WXVideoObject videoObject = new WXVideoObject(); // 2、设置视频url videoObject.videoUrl = "http://v.youku.com/v_s
Android 隐藏底部三个虚拟按键
工具类中使用 // 隐藏底部的虚拟按键 方法一 滑动屏幕 可重新显示出来 public static void hideBottomUIMenu(Activity activity) { //隐藏虚拟按键,并且全屏 if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api View v = activity.ge
Android传感器的使用
Android 中主要的传感器有以下几种 TYPE_ACCELEROMETER 加速度传感器又叫 G-sensor,该数值包含地心引力的影响,单位是 m/s 测量应用于设备 x 、y、z 轴上的加速度。 将手机平放在桌面上,x 轴默认为0,y 轴默认0,z 轴默认9.81。 将手机朝下放在桌面上,z 轴为-9.81。 将手机向左倾斜,x 轴为正值。 将手机向右倾斜,x 轴为负值。 将手机向上倾斜,...
Android使用MPAndroidChat
参考文档: https://blog.youkuaiyun.com/u013184970/article/details/52095170 https://blog.youkuaiyun.com/cen_yuan/article/details/52204281 注意: 在要使用的module的build.gradle添加: dependencies { compile ‘com.github.PhilJay:MPAnd...
用startSmoothScroll实现RecyclerView滚动到指定位置并置顶,含有动画。
RecyclerView滚动到指定位置并置顶 RecyclerView本身提供了几个定位的方法,除了手动滑动的scrollTo,smootScrollTo和scrollBy,smoothScrollBy方法之外,有一个直接滑动到指定位置item的scrollToPosition方法和另一个在此基础上平滑滚动的smoothScrollToPosition方法。但是经实验,该方法只能保证指定位置的item滑动到屏幕可见,如果指定的item本来就已在屏幕可见范围,则不会滑动,并且屏幕外的item滑到可见范围后,还
479



被折叠的 条评论
为什么被折叠?



